GithubHelp home page GithubHelp logo

chipsenkbeil / grid-side Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 21.0 15.61 MB

Personal portfolio and blog for use by the Hugo generator.

License: MIT License

HTML 13.63% JavaScript 24.30% CSS 62.07%

grid-side's Introduction

GridSide Theme

The GridSide theme is a multi-page portfolio and blog utilizing the Materialize frontend framework. Comments can be added using Disqus.

The theme contains a main page with a single grid of images representing different sections of the website. Sections can be post, gallery, or project for various rendering.

  • Current Materialize version is 0.97.0.
  • Current Font Awesome version is 4.4.0.
  • Current Masonry.js version is 3.3.1.
  • Current imagesLoaded.js version is 3.1.8.
  • Current Modernizr.js version is 2.8.3.
  • Current Highlight.js version is 8.7 and contains all 130 languages.
  • Current lazysizes.js version is 1.2.0.
  • Current ls.noscript.js version is 1.2.0.
  • Current lightbox.js version is 2.8.1.
  • Current infinitescroll.js version is 2.1.0.

GridSide Theme Screenshot

Contents

Installation

Inside the folder of your Hugo site run:

$ mkdir themes
$ cd themes
$ git clone https://github.com/chipsenkbeil/grid-side

For more information read the official setup guide of Hugo.

Getting Started

The Config File

Take a look inside the exampleSite folder of this theme. You'll find a file called config.toml. To use it, copy the config.toml in the root folder of your Hugo site. The config file contains detailed explanation of each available property. Feel free to customize this theme as you like.

Setting the header

The header of the homepage serves as the main attraction for visitors. You can provide your name, a description, and your email address on top of an image.

[Params.Header]

    name = "Your name"
    description = "Your description"
    email = "[email protected]"
    image = "path/to/your/header/image"

Each field in the header is optional, meaning that you can choose to not provide a name, description, or email. There are additional options you can use in the header section as well! For more information, check out the example config.toml.

The footer of the homepage serves to provide contact links and other miscellaneous connections from your main website. Each entry is composed of a font awesome icon and a url. The icon is specified via icon_class and represents the specific font awesome icon. E.g. twitter becomes fa fa-twitter. The url is specified via icon_link.

[Params.Footer]

    [[Params.Footer.List]]

        icon_class = "twitter"
        icon_link = "https://www.twitter.com/..."

    [[Params.Footer.List]]

        icon_class = "github"
        icon_link = "https://www.github.com/..."

Each field in the header is optional, meaning that you can choose to not provide a name, description, or email. There are additional options you can use in the header section as well! For more information, check out the example config.toml.

Adding homepage cells

The other main aspect of the homepage is the homepage cells, or the grid of images below your header. Each cell contains an image depicting its content along with a title that is visible upon hovering over it. Each cell acts as a hyperlink to other content on your site.

[Params.Cells]

    [[Params.Cells.List]]

        name = "Section name"
        link = "/some/path/on/your/site"
        image = "/some/image/file"

There are additional options you can use for each cell as well! For more information, check out the example config.toml.

Specifying the main menu

The main menu used on all list templates is specified via the menu name, "Main". The fastest way to set your menu is to specify the SectionPagesMenu option at the root of your config.

SectionPagesMenu = "Main"

Creating a post

Each post in a post section should have the following front matter:

+++
title = "Post title"
date = "YYYY-MM-DD"
tags = [ "tag1", "tag2", ... ]
categories = [ "category1", ... ]
+++

Additionally, you can specify an image via the front matter image = "url".

Creating a project page

Each project in a project section should have the following front matter:

+++
title = "Project title"
tags = [ "tag1", "tag2", ... ]
categories = [ "category1", ... ]
+++

Furthermore, an image should be provided via image = "url" for more visual effect. If one is not provided, a placeholder will be used.

Additionally, you can provide videos as an alternative to an image, which will be displayed using the HTML5 video tag. Each of the following is optional:

+++
video_mp4 = "/path/to/mp4"
video_webm = "/path/to/webm"
video_ogv = "/path/to/ogv"
video_3gp = "/path/to/3gp"
video_fallback = "/path/to/image"
+++

The video fallback option is used both as the poster of the loading HTML5 video and as the filler image if HTML5 video is not supported by the browser.

Each gallery image needs to be specified through the front matter of an individual content item.

+++
title = "Image title used in lightbox"
date = "YYYY-MM-DD"
image = "/path/to/image"
+++

Adding a custom post section

By default, the theme provides a custom view of post/. If you would like to have a different section name than post, you can specify the section by creating the following:

For layouts/custom_post_section/single.html:

{{ partial "post/single.html" . }}

For layouts/section/custom_post_section.html:

{{ partial "post/list.html" . }}

Adding a custom project section

By default, the theme provides a custom view of project/. If you would like to have a different section name than project, you can specify the section by creating the following:

For layouts/custom_project_section/single.html:

{{ partial "project/single.html" . }}

For layouts/section/custom_project_section.html:

{{ partial "project/list.html" . }}

By default, the theme provides a custom view of gallery/. If you would like to have a different section name than gallery, you can specify the section by creating the following:

For layouts/custom_gallery_section/single.html:

{{ partial "gallery/single.html" . }}

For layouts/section/custom_gallery_section.html:

{{ partial "gallery/list.html" . }}

Nearly Finished

In order to see your site in action, run Hugo's built-in local server.

$ hugo server -w

Now enter localhost:1313 in the address bar of your browser.

Contributing

Report any bugs using the issue tracker. Submit your own bug fixes or feature additions via a pull request.

License

This theme is released under the MIT License. For more information read the license.

grid-side's People

Contributors

alrayyes avatar bep avatar cale-inspired avatar chipsenkbeil avatar magomimmo 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

Watchers

 avatar  avatar  avatar

grid-side's Issues

youtube shortcode

Hi, first of all thanks so much for sharing your hugo theme.

I'm using {{% youtube bbbbbb %}} shortcode inside contents. Is there a way to add a loop flag inside that shortcode?

Thanks

Add support for CSS-only Masonry layout

I spent two days investigating this and could not find a solution that worked. Eventually, I gave up and added the Masonry Javascript library. My two attempts were as follows:

Using CSS Columns

CSS Columns enabled an easy, powerful way to spread page summaries across multiple columns. Furthermore, you can prevent page summaries from being broken up in the middle by using column-break-inside: avoid;. However, I had no way to order the page summaries dynamically such that the most recent summaries were at the top (from left to right) and older summaries were found further down. Instead, this resulted in the latest summary starting in the top left with older summaries going down the first column and into the second, etc.

.page-summary-container {
    -moz-column-count: 3;
    -webkit-column-count: 3;
    column-count: 3;

    -moz-column-gap: 0;
    -webkit-column-gap: 0;
    column-gap: 0;
}

.page-summary {
    display: inline-block;
    -webkit-column-break-inside: avoid; /* Chrome, Safari */
    -moz-column-break-inside:avoid;
    -o-column-break-inside:avoid;
    -ms-column-break-inside:avoid;
    column-break-inside:avoid;
    page-break-inside: avoid;           /* Theoretically FF 20+ */
    break-inside: avoid-column;         /* IE 11 */
}

Using Flexbox

This involved using flexbox to simulate a Masonry layout by using flex-flow: column wrap to have items flow from top to bottom with no extra spacing (similar to Masonry). There were two issues with this approach: page summaries still flowed from top to bottom instead of left to right and I couldn't control wrapping the column into the next column without providing a fixed-height container.

The first issue was able to be solved by swapping the order of the elements, which you can do in flexbox. Since the list page is using pagination (meaning that I can guarantee the total page summaries per page), ordering the elements was as simple as adding child selectors to break up the order based on the number of elements:

.page-summary:nth-child(3n+1) {
    order: 1;
}

.page-summary:nth-child(3n+2) {
    order: 2;
}

.page-summary:nth-child(3n) {
    order: 3;
}

Unfortunately, as I couldn't provide a fixed-height container, the column approach did not work as all elements stayed in the first column. I could not find any working way to forcefully wrap flexbox elements after a certain element when using column as the flow instead of row (where you can set the row item to a width of 100%).

I could have forced a specific height for the page summaries as I know how big the text will be (roughly) if I use an ellipsis for overflow on the title (and the summary is always 70 words max). However, the optional image throws off my sizing estimates.

Smaller screens cannot access lower main menu icons

Currently, smaller screens result in icons on the main menu not being accessible. Trying to use overflow-y: scroll; on the main menu nav solves the issue, but results in the submenus not being visible (and a scrollbar appearing for them as well).

Maybe add a media query to collapse the icons into something usable?

Add ability to have content that purely redirects to another url

Currently, the list shows content including the title of the article, a summary of the article, any associated tags, and optionally a header image representing the article.

A nice feature that I would need for my own website's sections would be image only options in the same vein as the cells on the main page, where hovering over the cell highlights it and displays text. Clicking the cell redirects you to a new url. This would be useful for projects that might just point Github repositories.

Recreate cell and header partials when limitation is gone

Both the cell and header partials for the homepage had to be added back in to the main html template file due to the fact that they needed access to .Site.BaseURL. Currently, there is no way to pass additional arguments to a partial and using a partial on a parameter (like .Site.Params.Header) results in you losing access to the scratch area.

If this gets resolved, I want to move the contents back out to individual partials.

Split partials into more components

Since it seems that Hugo's design begs for a variety of small partials that can individually be replaced by users of themes, this theme should try to split some of its larger partials into more manageable pieces that can be overridden.

Furthermore, all partials currently live in layouts/partials, but should be moved to more specific subdirectories such as layouts/partials/cells for better organization.

Add mobile-friendly option for main page menu

As mobile devices cannot hover, there is no way to see the text of the menu items represented by the pictures. While the pictures themselves should indicate what section of the website you are visiting, it would be nice to have an option for mobile devices. There is Javascript in Modernizr to detect touch, so we could probably assume that mobile devices have Javascript enabled and provide custom CSS for touch-only devices.

Note that other Hugo themes like Artists and Creative do not appear to have any logic to show the text for mobile devices, but their pictures are for a portfolio (projects) and not the main menu.

Combine all Javascript files for faster delivery

Currently, there are quite a few individual vendor Javascript files that are loaded. Furthermore, the Javascript employed on different pages is scattered in various script tags.

It might be a nice idea to consolidate the files (somehow) to provide a simpler delivery. Need to double-check the pros/cons.

Add detail to project section

Backing out of using vex to provide modal dialog (was not consistent in attaching to click event). Investigated flipping animation on card, but had to use hack of keeping a copy of content and making it invisible combined with absolute positioning for other content to keep the card the same size.

Need to consider how to show detail about projects before redirecting.

Parallax scrolling of image on main page is rough

I've noticed that the image used in parallax scrolling on the main page seems to jump a little bit when scrolling (as if being repositioned). Need to investigate the issue. Maybe if I can move from the tag <img> to the CSS property background-image with background-size set to cover it will handle size changes more easily.

Move CSS to file

Currently, CSS is located in a partial along with style tags and quite a lot of manual styling on individual elements. This needs to be moved to a CSS file that makes it easier to edit/extend.

Option to remove 'post' from Main menu

Although I have left all of my blog posts as individual markdown files under /post/ I have customized my menu, mainly using category to organize my blog posts. So I don't need a menu item for 'post' - but I can't find where that is being inserted, other than perhaps some default Hugo functionality. Is this something that I need to change in the theme, or is it in the main Hugo code?

Cannot create a new custom post section

Hey there,
first of all: I am still very new to Hugo, so excuse me if the answer to my question should be obvious...

What I am trying to do:
I would like to have several blog sections, sorted by content category (e.g. health, games, cars). All of those sections should have the same layout but (of course) different articles.
The structure is supposed to be:
site.com/health/health-post1/
site.com/games/games-post1/
etc.
If this is achieved, I would like to go a step further and have site.com/all/ as well, where all posts of the listed sections will be shown. (Is this possible?)

What I have tried so far:

  1. Create folder "health" in /content/ and add articles.
  2. Add folder "health" to /layouts/ and put single.html in there with partial post/single.html.
  3. Add health.html to /layouts/section/ with partial post/list.html.
    => Result: I can access site.com/health/, however, it shows the same content as site.com/post/.
    As far as I understood your exampleSite, you did the same: You have created a custom post section which shows the same content as the post section.

My question:
How can I do the same I have achieved so far, but with unique content for each section?

I have read the hugo docs on sections but they didn't help me... Maybe I still get something completely wrong about how sections work.

THX!

Support responsive images

Sorry, I'm not a front-end specialist, so this issue may reflect my ignorance. But what would it take in order to support the HTML5 picture tag, or something like it, so there's an easy way to load big images for big screens and smaller images for phones etc? I'd be glad to help implement, if I could.

.Now will be deprecated with Hugo v0.20

.Now will be deprecated replaced with the now template function in Hugo v0.20 which eventually will be released on Monday. It's likely that the deprecation will cause builds to fail.

Disqus not loading

After fixing my compile error, I can see that the disqus shortname is set in config.toml and is being pushed to my source repo on github. But when I run hugo -d and compile the site to its own directory the resulting html files do not contain the disqus code. It seems like the 'if' statement in disqus.html isn't seeing that the disqus shortname has been set.

Add search page to use for search navbar link when Javascript disabled

Rather than part of a site addition, I want the theme to be able to support a search page or some sort of alternative to the Javascript-only solution. I've experimented with CSS-only options to imitate the same setup as the Javascript lightbox, but am hesitant towards the consistency across browsers.

Update font awesome?

I tried to add the snapchat icon to the footer bar, and thus figured out that it is not included.
According to fontawesome.io, there are snapchat icons. Is it right to assume that the included font awesome version is just outdated?

If so, do you plan to update it in the future or am I supposed to do that myself?

Infinite scroll fails when site is https

My site at https://www.mattstratton.com enforces SSL on all url's. The infinite scroll feature doesn't work, as it tries to load an endpoint over http.

GH URL is https://github.com/mattstratton/mattstratton-web

I have the baseurl set at https://www.mattstratton.com, but it doesn't seem to take that in.

Mixed Content: The page at 'https://www.mattstratton.com/post/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.mattstratton.com/post/page/2/'. This request has been blocked; the content must be served over HTTPS.

Gallery images do not show up when javascript disabled

I thought I had correctly implemented the noscript implementation of the gallery that uses standard flexbox, but something is broken where the images are not loaded if javascript is disabled (boxes appear with correct dimensions for each image).

Homepage not rendering properly

Newbie here.

I tried using the posts from the exampleSite as a template to create my own site. Using the default config.toml gives me an empty home page with only the 'about me' image without the rest of the description. I have copied all the static assets to the required location.

Could you help me with figuring out how I can solve this?

Add support for multiple galleries

Currently, galleries are limited to the gallery section, rather than being able to add a custom section to represent a gallery. It would be nice to support arbitrary sections for a gallery.

Revise 404 page

The 404 page is just a filler to remind myself to make a real 404 page with a search option. Need to think of how to tie it in with the grid/Masonry style.

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.