Giter Site home page Giter Site logo

formspree / blogophonic-hugo Goto Github PK

View Code? Open in Web Editor NEW
191.0 15.0 46.0 9.67 MB

Blogophonic – a Hugo blog theme by Formspree

License: Creative Commons Attribution 4.0 International

HTML 19.24% SCSS 80.76%
gohugo hugo-site hugo-blog responsive-design formspree tachyons

blogophonic-hugo's Introduction

Blogophonic - a blog theme for Hugo by Formspree

A modern, beautiful, and easily configurable blog for Hugo that includes a dedicated page with a functional contact form.

See the demo here

screenshot

Three Reasons to Use Blogophonic

  1. Blogophonic is thoughtfully crafted with features a blog should have: multiple layouts - including one with a sidebar; custom sidebar text with a sticky ad container; option to hide byline, dateline, and thumbnail images.

  2. Styled with Tachyons - A design system for todays modern, generated websites. Avoid complex cascades and unintended side effects while taking advantage of Tachyons community library of components.

  3. Forms Built-in - Collect inquiries fast and easy with a contact form powered by Formspree ... you don't need a server or any programming knowledge. Just configure the form page and submit once to set it up.

Usage

NOTE: blogophonic-hugo requires the extended version of hugo, since it relies on hugo's built-in SASS processor. As of Jan 11, 2021 hugo-extended is installed by default when running brew install however, for windows or linux users, you must ensure you've installed the extended version. Please see https://gohugo.io/getting-started/installing/.

This as a full website, not a hugo theme. To use it, just clone the repo, and start hugo at the root:

git clone [email protected]:formspree/blogophonic-hugo.git
cd blogophonic-hugo
hugo server

Then you can edit or discard the pages under content.

This repo should not be cloned into a git submodule. It's meant to be the top-level folder and includes a content folder with several pre-made pages.

We chose to package it this way because at the time it was difficult to distribute a hugo theme with a lot of pre-made pages, images, static content, etc.

Site Configuration

The following site configuration options are found in the config.toml file at the root of this Hugo site.

Font Options

Blogophonic uses Tachyons to render beautiful system font stacks for your site, making it super simple to configure and blazing fast to load. The default choices are sans-serif or serif, and can be assigned to headings and body text respectively. Additional options can be found in the Tachyons Font Family Reference.

textFontFamily = "sans-serif"
headingFontFamily = "sans-serif"

Basic Color Options

Again, relying on Tachyons, Blogophonic provides many different color combinations that you can mix and match to your hearts content. The defaults are shown here, with many more available by browsing the Tachyons Color Palette. Note: Color names must match exactly, the color name found in the reference page linked above.

siteBgColor = "near-white"
sidebarBgColor = "light-gray"
headlineColor = "dark-pink"
headingColor = "near-black"
textColor = "dark-gray"
sidebarTextColor = "mid-gray"
bodyLinkColor = "blue"
navLinkColor = "near-black"
sidebarLinkColor = "near-black"
footerTextColor = "silver"
buttonTextColor = "near-white"
buttonBgColor = "black"
buttonHoverTextColor = "white"
buttonHoverBgColor = "blue"
borderColor = "moon-gray"

Social Icons

There are three places where you can choose to show social icons: header, footer, and contact page. Header and footer options are found in site config (config.toml) alongside the social accounts.

[params]
# show/hide social icons in site header/footer
socialInHeader = false
socialInFooter = false

[social]
  # social accounts (username only)
  facebook = "formspree"
  instagram = ""
  youtube = ""
  twitter = "formspree"
  github = "formspree"
  medium = ""

Social icons are available for Facebook, Instagram, YouTube, Twitter, GitHub, and Medium. There are many more available if you like, we just trimmed the initial offering down to what a blog might need. To add more, just follow the same methodology we used:

Starting with a copy of a Tachyons Component that uses Simple Icons SVG's, we put them into a simple partial file layouts/partials/shared/social-links.html which controls the display.

Page Configuration

The following page configuration options are found in each pages front matter.

Blog Pages

There are two sets of blog front matter. One set is for the blog itself (/blog/_index.md), and the other for each blog post, which consist of front matter plus content (/blog/my-blog-post.md).

Blog List

For the blog, there are three layout choices: list, list-sidebar, or list-grid. We list the blog posts with a title and excerpt plus a thumbnail, byline, and dateline according to your boolean choice here. This is also where you enable the display of Disqus comments.

layout: list-sidebar # list, list-sidebar, list-grid
show_post_thumbnail: true
show_author_byline: true
show_post_date: true
show_disqus_comments: false # see disqusShortname in site config

Blog Post

In the front matter of a blog post, along with things you'd expect like title, subtitle, excerpt, and author, there are two choices for layout: single or single-sidebar. In the images array, the first one will be used as the blog post thumbnail in the list, so it's best to name the file as such for clarity. Note: the Open Graph internal template will use up to six of these images in the page metadata for social sharing.

images:
  - /blog/assets/built-in-contact-form-thumbnail.png
  - /blog/assets/built-in-contact-form-feature.png
layout: single # single or single-sidebar

Sidebar Content

When you use either the list-sidebar or single-sidebar layout in your blog, the sidebar contents are controlled with a data file (/data/sidebar_content.yaml) containing a set of front matter for each sidebar. In this file you can specify an image, title, description, author name (good for groups or teams), a text link and a boolean for the ad unit. Note: the code for the actual ad that you may choose to display will live in the layouts themselves, not in this data file.

text_link_label: View Recent Posts
text_link_url: /blog
show_sidebar_adunit: true # show ad container

Contact Page

This website comes with a Formspree form that's designed to work with a static website. You can use hugo new to create a new form in the /form directory or, just use the one already present in the site content.

hugo new form/contact.md

Your new contact page contains auto-generated front matter that defines the form name, title, date, and url, and more. Most important is the formspree_form_id key. Replace [email protected] with your form's hashid. You can find this on the integration page which is displayed after you create a new form. It looks like https://formspree.io/<hashid>.

You can also specify a description that will display below the title, choose a right or left position for the form itself via layout, set a preferred submit_button_label, and toggle a few things on or off.

description:
layout: split-right # split-right or split-left
submit_button_label: Send
show_social_links: true
show_poweredby_formspree: true
formspree_form_id: [email protected]

Regular Page

A regular page (not a form and not a blog) has a few configurations as well. There are two layout options: standard or wide-body, and an option to show the page title as a large headline at the top above the content.

layout: standard # standard or wide-body
show_title_as_headline: false

Custom Color Options

Let’s say you have a style guide to follow and washed-blue just won’t cut the mustard. We built Blogophonic for you, too. There is an override of these predefined colors available, you just need to dig a little deeper.

In the assets folder, locate and open the main SCSS file (/assets/scaffold.scss). After the crazy looking variables you probably don’t recognize, and directly following the Tachyons import (@import 'tachyons';) you’ll see a comment that looks just like this:

// uncomment the import below to activate custom-colors
// add your own colors at the top of the imported file
// @import 'custom-colors';

To enable the custom colors override, simply un-comment the custom-colors import, and it will look like this:

// uncomment the import below to activate custom-colors
// add your own colors at the top of the imported file
@import "custom-colors";

Save that change, and now the color options in the config.toml are no longer active – they’ve been bypassed. To customize the colors, locate and open the custom-colors file found in the theme assets (/assets/custom-colors.scss). At the top of that file, you’ll find a whole new set of variables for all the same color options, but this time you get to assign your own HEX codes. Go to town.

// set your custom colors here
$siteBgColorCustom: #e3e3da;
$sidebarBgColorCustom: #dbdbd2;
$textColorCustom: #666260;
$sidebarTextColorCustom: #666260;
$headingColorCustom: #103742;
$bodyLinkColorCustom: #c4001a;
$navLinkColorCustom: #c4001a;
$sidebarLinkColorCustom: #c4001a;
$footerTextColorCustom: #918f8d;
$buttonTextColorCustom: #f7f7f4;
$buttonHoverTextColorCustom: #f9f9f8;
$buttonBgColorCustom: #103742;
$buttonHoverBgColorCustom: #c4001a;
$borderColorCustom: #c4beb9;

License & Attribution

Creative Commons License
Blogophonic by Formspree is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/formspree/blogophonic-hugo.

Additionally the following assets have separate licenses:

blogophonic-hugo's People

Contributors

apreshill avatar colevscode avatar esquareda avatar rohitdatta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blogophonic-hugo's Issues

Blogophonic theme doesn't work with Fresh Hugo install

I do not have any data in my folder/ hugo repository. Following the quick start guide from hugo, I added blogophonic to the themes folder and changed config.toml. Hugo server -D doesn't start succesfully.

Specific error:

Building sites … ERROR 2019/08/17 16:35:25 render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:33:17: executing "_internal/opengraph.html" at <index $siteSeries $name>: error calling index: index of untyped nil
ERROR 2019/08/17 16:35:25 render of "page" failed: execute of template failed: template: blog/single-sidebar.html:3:8: executing "blog/single-sidebar.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:33:17: executing "_internal/opengraph.html" at <index $siteSeries $name>: error calling index: index of untyped nil
Total in 221 ms
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:33:17: executing "_internal/opengraph.html" at <index $siteSeries $name>: error calling index: index of untyped nil

Running it with a different theme (I tested hugo-lamp), and Hugo starts successfully, and I'm able to see a splash page with

There's nothing here.
Create an interesting post with the command:

$ hugo new post/hello-world.md

Change colour

I would like to change the colour for the text inside backticks that is within a blockquote but not for block code, how can I do this easily?
Edit: manage to find the css line for this.

How to add blog posts grid to homepage

Hi.

I'm having some trouble adding a list of recents blog posts to the homepage.
I'm adding in line 19 of file layouts/index.html:
{{ partial "blog/list-grid.html" }}

Any help?

Kindly add a headless cms e.g Forestry.io

Hi, how are you?
Could you kindly add forestry cms or netlify for easier and newbie friendly publishing.
Also i have a question. Does this support multiple authors?
Thank you

Code is rendered behind the side bar

Screenshot 2021-09-19 at 6 51 16 PM

If the code is really long, we can see it extended behind the sidebar, blocking the content. At the very least, can we get it to show above the side bar, or have an option to wrap the text?

Or have it scrollable like how GitHub does it?

404 page is not loading correctly

If I go to sample.com/asdfsd the 404 page loads correct, but if I go to sample.com/adfafds/adsfas, the CSS and images are not using the correct path. I have already set the nginx config accordingly, specify error_page 404 /404.html.

Is there something I am missing? The image it is trying to link to is sample.com/adfafds/img/logo.png instead of sample.com/img/logo.png. Seems like the extra folder path confused it?

Nested pages

Hi, new to this, pardon me if I am lacking any knowledge.

I have some issue creating nested pages in markdown, if I want to have just a few plain html files, e.g.:
/projects/index.html (works ok) and then link to /projects/project1/index.html (gives 404 after restart) and /projects/project1/showcase.html (gives 404). I tried adding _index.md in /projects/project1/ as per the Hugo docs but it did not work.

I can simply do markdown files for /projects.html and /showcase1.html in the same folder but it would be good to group them together in the folders and have the same domain path as well. Pretty sure I am missing something basic.. can someone point me in the right direction?

These are the commands I used:

hugo new --kind page projects/index.md
hugo new --kind page projects/project1/index.md
hugo new --kind page projects/project1/showcase.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.