GithubHelp home page GithubHelp logo

yihui / hugo-xmag Goto Github PK

View Code? Open in Web Editor NEW
95.0 9.0 48.0 343 KB

A minimal magazine theme for Hugo

Home Page: https://xmag.yihui.org

License: MIT License

HTML 65.56% CSS 34.44%
hugo-theme magazine-theme

hugo-xmag's People

Contributors

5jt avatar chuxinyuan avatar lchiffon avatar mjain2 avatar swflint avatar xiangyunhuang avatar yihui avatar yixuan 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-xmag's Issues

Blackletter Unicode kluge

Specifying the blackletter Unicode positions in the Optima font yields a barely legible banner. (I have not looked, but doubt the font for Zapf’s Optima includes glyphs for these positions. If not, the OS is haphazardly picking them from other fonts with unpredictable results.)

Google Fonts includes two well-designed blackletter faces: UnifrakturCook and Pirata One. The upper-case transform works badly with blackletter type.

Errors on site without expected parameters set

Hello!

$subj, when trying to run this theme against my blog source I get following:

Building sites … ERROR 2018/03/20 19:04:10 Error while rendering "page" in "post/": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:10 Error while rendering "page" in "": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:11 Error while rendering "taxonomy" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:11 Error while rendering "home" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:11 Error while rendering "section" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:11 Error while rendering "taxonomyTerm" in "": template: theme/_default/terms.html:1:3: executing "theme/_default/terms.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil
ERROR 2018/03/20 19:04:11 Error while rendering "404" in "": template: theme/404.html:1:3: executing "theme/404.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:6:46: executing "theme/partials/header.html" at <index .Site.Params.t...>: error calling index: index of untyped nil

The reason is likely some absent .Site. parameter but you can't tell it from error message, I guess input parameters handling could be improved. cboettig/hugo-now-ui#9 might be used as reference point.

Hugo XMag can not be removed from title

Hi Yihui,
I recently start blogging with Hugo, and when I want to write about data science method, I turned to blogdown to facilitate R Markdown.

I'm trying to playground with your hugo-xmag theme.

But I can't find a way to change the title of the site shown in web browser.

Generally the tag in web browser shows title = @your-title in config.toml. But with this theme "Hugo XMag |" will be prefixed to the @your-title setted, as well as the top left of the homepage, there is a Hugo XMag text.

I tried to find where you defined these with the following command:
grep -rnw themes -e 'xmag'
But it seems you bury it deeper than what I can find.

So can you help me figure it out?

Best,
Bo Sun

Blackletter Font not supported at Mobile

Some characters in site title which is formatted to Black letter don't work on mobile browser. I tried to access to site through Firefox and Chrome browser on Android phone.

Wish to report a minor issue with broken link from 'github_edit'

Dear Yihui,
Wish this message finds you well. I really like the layout of this theme (xmag), just like the "Capital of Statistics"! It is a great idea to write blog using R Markdown. Thank you for all these efforts to make R Blogdown possible. And thank you for creating this nice theme.

There is a minor issue (I hope it is not specific to me...), when I build your sample site on Windows 10 (R Studio), the github_edit link generates a "%5C" instead of "/", and leads to GitHub 404 page. For example, the link when I click "Edit this page" on your sample site on my computer, the link is:
https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/post%5c2015-07-23-lorem-ipsum6.md
which doesn't work.

All the packages, R, R Studio are the latest. I suspect it is a problem associated with markdown but I haven't figured it out by searching.

Moreover, I personally suggest that this part can actually be removed (incl. Back to Home, date, Edit this page) to make the layout even more focused and less distracting. I suppose they are not so useful to blog readers. I haven't yet figured out how to do it myself... I guess might not be that easy

Still, lots of thanks for creating the fantastic Blogdown.
Have a nice weekend,
Yang

add subtitle support

dont you think this can look better

<h1><span class="title">{{ .Title }}</span></h1>
<h3><span class="subtitle">{{ .Params.subtitle }}</span></h3>

error

can you update your theme bro, looks like your theme doesn't support hugo version now, or tutorial clearly to install it, I'm a newbie

Build fails on Quickstart

Summary

Following the Quickstart guide and substituting XMag for the Ananke theme produces an error when the site is served.

Environment

  • Mac mini (Late 2014)
  • Mojave macOS 10.14.6
  • 8GB RAM

Replication

❯ hugo version
Hugo Static Site Generator v0.70.0/extended darwin/amd64 BuildDate: unknown
❯ hugo new site quickstart
Congratulations! Your new Hugo site is created in /Users/sjt/tmp/quickstart.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/ or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
❯ cd quickstart
❯ git init
Initialized empty Git repository in /Users/sjt/tmp/quickstart/.git/
❯ git submodule add https://github.com/yihui/hugo-xmag.git themes/xmag
Cloning into '/Users/sjt/tmp/quickstart/themes/xmag'...
remote: Enumerating objects: 547, done.
remote: Total 547 (delta 0), reused 0 (delta 0), pack-reused 547
Receiving objects: 100% (547/547), 338.23 KiB | 959.00 KiB/s, done.
Resolving deltas: 100% (239/239), done.
❯ echo 'theme = "xmag"' >> config.toml
❯ hugo new posts/my-first-post.md
/Users/sjt/tmp/quickstart/content/posts/my-first-post.md created

Expected result

                   | EN
+------------------+----+
  Pages            | 10
  Paginator pages  |  0
  Non-page files   |  0
  Static files     |  3
  Processed images |  0
  Aliases          |  1
  Sitemaps         |  1
  Cleaned          |  0

Total in 11 ms
Watching for changes in /Users/sjt/tmp/quickstart/{content,data,layouts,static,themes}
Watching for config changes in /Users/sjt/tmp/quickstart/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Observed result

❯ hugo server -D
Building sites … ERROR 2020/05/20 08:55:09 render of "section" failed: execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/Users/sjt/tmp/quickstart/themes/xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2020/05/20 08:55:09 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/Users/sjt/tmp/quickstart/themes/xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2020/05/20 08:55:09 render of "page" failed: execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "/Users/sjt/tmp/quickstart/themes/xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2020/05/20 08:55:09 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/Users/sjt/tmp/quickstart/themes/xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
Built in 4 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/Users/sjt/tmp/quickstart/themes/xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil

Remarks

This appears to duplicate issue #12, closed without comment.

If there are other initial conditions that must be satisfied they could be documented at the source repository.

Can not build this code

When I try to build my site using this code getting an error like this
"execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "C:\Hugo\hugo-xmag-master\layouts\partials\header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil"

render fail

I'm running into errors when I'm trying to run this theme for the first time. Here are the terminal commands I ran when setting up with hugo v0.105.0:

hugo new site hugotest
cd hugotest
git init
git submodule add https://github.com/yihui/hugo-xmag themes/hugo-xmag
echo theme = \"hugo-xmag\" >> config.toml
hugo new posts/my-first-post.md
hugo server -D

Upon running hugo server -D I get:

Start building sites … 
hugo v0.105.0+extended darwin/arm64 BuildDate=unknown
ERROR 2022/11/09 14:01:39 render of "page" failed: "/hugotest/themes/hugo-xmag/layouts/_default/single.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "/hugotest/themes/hugo-xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2022/11/09 14:01:39 render of "taxonomy" failed: "/hugotest/themes/hugo-xmag/layouts/_default/terms.html:1:3": execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/hugotest/themes/hugo-xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2022/11/09 14:01:39 render of "taxonomy" failed: "/hugotest/themes/hugo-xmag/layouts/_default/terms.html:1:3": execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/hugotest/themes/hugo-xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
ERROR 2022/11/09 14:01:39 render of "section" failed: "/hugotest/themes/hugo-xmag/layouts/_default/list.html:1:3": execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/hugotest/themes/hugo-xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
Error: Error building site: failed to render pages: render of "home" failed: "/hugotest/themes/hugo-xmag/layouts/_default/list.html:1:3": execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/hugotest/themes/hugo-xmag/layouts/partials/header.html:6:46": execute of template failed: template: partials/header.html:6:46: executing "partials/header.html" at <index .Site.Params.text (print "title_" (lower .Title))>: error calling index: index of untyped nil
Built in 7 ms

Please fix or share how to fix, thanks!

How to unlist page?

I'd like to be able to create "hidden" posts: available for those with the link, but without the posts showing in any lists. I found this solution to unlisting posts from lists. I can't get the solution to work - not sure if it is due to the xmag-theme, or something else.

The idea is to add a parameter unlisted=true to the front matter of the files to be "hidden". I have tried adding the filter to list.html, but for some reason the files with unlisted=true are still showing. What is the correct customization of the list.html to make this work? I have been playing around with lines 5-8. I added this (where .Pages ".Params.unlisted" "!=" "true") to line 7.

5 {{ $pages := .Pages }}
6 {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
7 {{ $paginator := .Paginate (where (where $pages "Section" "!=" "") ".Params.unlisted" "!=" "true") }}
8 {{ range $paginator.Pages }}

Thanks for any tips!

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.