-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimalist website with homepage as content #330
Comments
I'm working on exactly this use case. Hope to have something ready soon. |
Great! |
Exactly what i'm looking for! |
Hi @spf13, any update on this feature? |
This feature is also interesting for me. Until now I used an own content type with just one entry, but this then breaks prev and next posts. |
@tkschmidt @falzm @RubenN I managed to come up with workaround that works good for me until there is a proper fix for this:
then add the following code to the
because the |
@mbertschler That's pretty brilliant. Way to work within the system. I don't mind that solution at all.... of course it would be nice to have a proper one at some point. |
@mbertschler : in my setup with v0.12. it is not a solution. Which version do you use? |
@zwotzie I am using v0.12 Contents of
Contents of
Contents of
I hope that helps. |
@mbertschler that works perfekt for me, except the title, which will be used from the config-file but that ok. Thank you very much. |
@mbertschler - I like your solution, but wouldn't it better to write in index.html something like this?
|
@tlipski it should work that way as well. How you write that part is totally irrelevant, because /index.html will only get generated once. |
@mbertschler I altered it this way so next/prev/title can work properly |
After two hours of trying to find out how to create a simple, non-blog – in that sense, actually static – website with Hugo, I finally arrived here. Thanks for the workarounds, guys! |
Nice workarounds, I really wish Hugo can support it by default |
👍 It would be great if Hugo had better support for homepage as a content file (and not as a layout file). On the sites I've been using Hugo on, the home page layout is the same as some other content pages. |
@spf13 Any news regarding this issue? I would love to use Hugo for static pages. |
I needed to customize some CSS only on the homepage, so I wanted to add a class to the <body class="page-{{ .Title | urlize }}"> And now I can make a CSS rule like: body.page-title-of-my-site {
background-color: #000;
} that's only applied on the homepage. |
👍 for handling index page content as a first class citizen. |
After experimenting with themes, I decided to build my site from the ground up (but looking at themes for reference). It's a small, personal site, but I want to devote most of the home page to my Flickr photos feed, and relegate the blog to a sub-section. As such, the home page will be fairly bespoke, with very little blog content, while the blog section will fit well with the content/templates model used by Hugo. So just to see it working (hello world, minimum viable product, iterate...) my entire home page is like this: layouts/index.html
Then I have the content files: content/index/heading.md
content/index/intro.md
I've basically done the same as @mbertschler (thanks!), but with the ability to have a couple of bits of content in different parts of the home page. I'm not 100% sure if I'll need that yet, but it's good to have the flexibility if I decide not to do the whole template in markdown. Edit: I can probably do the whole home page in a single markdown file using Shortcodes for any complex bits like a Flickr carousel. Still, it might be useful to get bits of content from various places at times. ;) |
This work-around doesn't seem to work for partials. For example, if including code like this:
How can I determine what page I am really on so as to display the correct title? |
Use The discussion site for questions. |
If I delete my question above, will you re-open this feature request? I think a number of people would like to have an index page. |
My bad ... I thought this was a new topic... Yes, this will come at some point. |
That's very good to know, thanks. :) And sorry to be lazy about signing up for the forums, but I've done that now. |
I would like to fix this for the next release. The question is how this could be implemented. My proposal would be that if there is an What are your thoughts? |
Simple, solid solution. I think the homepage should also fall back on Roy
|
I think this may already be the case.
|
This may be part of the solution, but it doesn't resolve all the issues. it
|
See https://discuss.gohugo.io/t/node-improvements/1593 Please, no hacks just to get the home page to "somehow work". |
@mbertschler Thank you! |
Will be handled in #2297. |
f97826a17 Merge commit '12ecbf4a1b05c2794281f47909c836b1a005bc19' 12ecbf4a1 Squashed 'themes/gohugoioTheme/' changes from ecad8247..fe71e360 aaa7ac214 Ignore .DS_Store files 0e023ca12 Remove comments in showcase front matter f3ba5ac87 Hartwell Insurance showcase 47aefdbda Remove unnecessary duplicated words 612693b4f Some minor language fixes a833ba15b Spelling 5972e70a9 Revert "showcase: Even smaller file" 3479b975e showcase: Even smaller file 2272e0b83 showcase: Reduce image size 718c3c3e5 Spelling 0b954eccb showcase: Pace copy-edits baded8064 showcase: Pace 842c1cedf Add a Showcase copyright notice c5963edaa Update installing 4fa0b0d73 Add link to showcase template d0f303916 Add some showcase guide content c809789b1 Add srcset to the showcase screenshots 49d875904 Start of a template 1153de221 Clean resouerces 69f00df4c Remove the showcases 653ad5bcd Add a simple byline c5342b5e5 Regenerate image after rebase b80669b34 Bump version in config.toml cd5c79c67 Fix an issue where whitespace wrap caused scrollbars on some browsers f00547e98 Add section to the title element aa10defed Iterating on Showcase (#330) 76a0bfbc3 Add some dummy content to some of the showcase pages 66f68964d Standardize showcase metadata 627ffa6d4 Adjust showcase image size on front page cbc3efece Redo some showcase images 054b54cb6 Use .RelPermalink and not .URL 82ba5f1c6 Add resources d1415795b Move showcase items in list view to a template in the layout f34620e90 Tweak details box for mobile df6a0bf24 Include images that changed from the column shift 02036581f Improve showcase single layout 5f7730c89 Improve styling of showcase prev/next buttons a2b2f7731 Remove extra div that was breaking mobile layout of the showcase b172fe5f4 Add block class to to images on mobile so they behave as expected a4ebfec86 Add a proper RSS feed to home page 0524479e0 Move showcase images to proper Resources 0544b57df Convert showcase pages to bundles 8febaab2b Add Showcase to Home page and internal pages 26d1f4542 Fix baseURL in Netlify deploy previews 046497616 Revert "Try to fix the Netlify preview baseURL setup" 80dce17ca Revert "Add some temporary baseURL debug" 8617e8692 Add some temporary baseURL debug 371e56bce Try to fix the Netlify preview baseURL setup 1b70b3f18 Add Netlify CMS to Frontends list d6184e71d Fix menu for "What is Hugo" page 1ae83ad3e Fix mobile menu display so it shows on mid-size displays f60e1f750 Edited slight typo, added "of" 56b906667 Fix typo c5bea5cbd Release 0.36 00539094e releaser: Prepare repository for 0.37-DEV b222cbdf2 releaser: Add release notes to /docs for release of 0.36 e59d1d766 releaser: Bump versions for release of 0.36 9620aa002 docs: Add documentation for smart cropping etc. 91c3801f1 Merge commit 'c305e44f5f081e4436195923a4593e396f07cd49' 8e71ff60b releaser: Prepare repository for 0.36-DEV git-subtree-dir: docs git-subtree-split: f97826a17209fe3e153b7f5bbf69c511e4e13203
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi
I'd like to use Hugo for my personal website, which roughly consists of two HTML pages:
I'm actually struggling to do a simple thing, which doesn't seem to be possible to do with Hugo: write the content of the homepage (a.k.a.
/index.html
) as Markdown —content/index.md
for instance —, among other content pages in thecontent/
directory. For what I understand from the documentation, the homepage has a special status, and requires a dedicated template file for display.My problem is: I don't want the content of the homepage to be directly in the HTML template, I want it to be written as Markdown in
content/
as any other page, and rendered/included in thelayout/index.html
template file. Is there any way to achieve this? If not, what simple workaround can you suggest so I can keep the simple structure of my website?Cheers,
m.
The text was updated successfully, but these errors were encountered: