yihui / hugo-xmin Goto Github PK
View Code? Open in Web Editor NEWeXtremely Minimal Hugo theme: about 140 lines of code in total, including HTML and CSS (with no dependencies)
Home Page: https://xmin.yihui.org
License: MIT License
eXtremely Minimal Hugo theme: about 140 lines of code in total, including HTML and CSS (with no dependencies)
Home Page: https://xmin.yihui.org
License: MIT License
Specifically what files should I override to create my custom list and single tag pages?
I tried many alternatives, but I wasn't able to customize the single tag page at all.
As can be seen on the demo page, a post without specified date frontmatter still shows "0001-01-01" as its date.
This is reproducable using this theme and a simple post under hugo 0.36.1:
---
title: Demo
---
This post does not specify date.
It seems that date now has a default value of 0
instead of nil
. This can be checked using {{ printf "%#v" .Params.date }}
.
Yihui, can you give me some tips on modifying your theme? I'd like to put a link in the footer of each blog post that jumps to the next/previous blog post.
Hey,
I'm not interested in singing a CLA so I'll open an issue:
At https://themes.gohugo.io/themes/hugo-xmin/ there is no direct link to the demo site at https://xmin.yihui.org/.
Please add the demosite variable to theme.toml. See https://github.com/gohugoio/hugoThemesSiteBuilder#theme-configuration.
So that there is a "Demo" button, like at https://themes.gohugo.io/themes/hugo-book/.
Would be very much appreciated!
I'm having issues building this theme any help would be appreciated! thank you!
:> hugo serve
Building sites … ERROR 2019/09/19 21:30:28 Error while rendering "taxonomyTerm" in "": template: _default/terms.html:8:21: executing "_default/terms.html" at <.Page.RelPermalink>: can't evaluate field Page in type hugolib.WeightedPages
I tried to use .Rmd
to generate figures with captions using R code chunks.
Following lines are used
```{r load data and visualization, message=FALSE, warning=FALSE, fig.cap=c("Matrix plot of all variables", "Linear trend of different groups")}
library(tidyverse)
birthsmoke <- read.table("https://onlinecourses.science.psu.edu/stat501/sites/onlinecourses.science.psu.edu.stat501/files/data/birthsmokers.txt", header = TRUE)
plot(birthsmoke)
ggplot(birthsmoke, aes(Gest, Wgt, color = Smoke)) +
geom_point(shape = 1) +
geom_smooth(method = "glm", se = FALSE) +
theme_minimal()
```
But unfortunately, the result is not intended (following screenshot). Is it possible to support caption more properly?
single.html can not render success by
<p class="terms">
{{ range $i := (slice "categories" "tags") }}
{{ with ($.Param $i) }}
{{ $i | title }}:
{{ range $k := . }}
<a href='{{ relURL (print "/" $i "/" $k | urlize) }}'>{{$k}}</a>
{{ end }}
{{ end }}
{{ end }}
</p>
format
error message:
Building sites … ERROR 2018/02/07 17:03:32 Error while rendering "page" in "note/": template: theme/_default/single.html:10:17: executing "theme/_default/single.html" at <.>: range can't iterate over HTML
Any suggestions for how to add a search box to the theme?
I'm trying to follow the advice in the blogdown book about SEO: https://bookdown.org/yihui/blogdown/useful-resources.html#helping-people-find-your-site, and am having some trouble getting description tags to work with this theme. What's the right way to do it?
It looks like if I implement a manual description on a markdown page, it doesn't get placed properly within the <head>
tags.
If I try to add description:
to the yaml, it is ignored.
I've been using the xmin template for ~6 months now. I just went on my website and noticed that the html formatting seemed to not be rendering properly. When I servesite()
in Rstudio, it renders correctly and looks great. I am able to push and deploy without any errors, but the website doesn't look like the serve site.
This is what it should look like:
And this is what it looks like when deployed:
Any idea what's wrong? I don't have an error code so I'm not sure how to even begin googling this.
I see this code at the bottom of every page:
<script async src="//yihui.name/js/center-img.js"></script>
I followed the method mentioned in the pull request for syntax highlighting using hightlight.js
, however I'm unable to get it to work.
layouts/partials/foot_custom.html
:
<script src="//yihui.name/js/math-code.js"></script>
<script async src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script async src="//yihui.name/js/center-img.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/languages/r.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/languages/python.min.js"></script>
<script>
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
</script>
layouts/partials/head_custom.html
:
<link href="https;//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/styles/gruvbox-dark.min.css" rel="stylesheet">
static/css/fonts.css
:
/* code */
pre {
border: 1px solid #3A3E41;
/* box-shadow: 5px 5px 5px #000; */
background: #f8f8f8;
padding: 1em;
overflow-x: auto;
}
code { background: #181A1B; }
pre code { background: none; }
Hi Yihui,
I followed your protocol to generate a new site using blogdown::new_site( theme = "yihui/hugo-xmin" )
, which produces the website in the "Viewer" pane. However, I encountered the following problem: when I navigate to "Categories -> Example", there is an error
Not found:
./categories/Example
I identified the source of the problem: it was because the folder names under public/categories/
are all lower-cased, even though some of the category names in the YAML header has their first letter capitalized. Since I don't fully understand how hugo generates the pages with lists of posts, I don't know how I can solve this problem.
Thanks!
Bin
Hi, add information about lastmod
in the posts.To get
2017/06/14
Updated 2017/06/17
Is there a real difference between a "note" and a "post" in this theme?
I am not seeing any, but if there is it would be nice to document it.
If there isn't, maybe it would be a good idea to remove?
Thanks!
打扰了,但我不知道在哪里可以表达我的喜爱 xx
Please change this to something like https://example.org/
. In the Hugo forums we get large number of new users that get in to trouble because they keep this example setting.
hugo-xmin/exampleSite/hugo.yaml
Line 1 in b76b60e
I've been using xmin for my blogdown theme since 2018. I recently updated the theme files because the 2019 version was no longer deploying the netlify correctly, but now my inline footnotes no longer work.
Here is an example page and you can see "^[]" in the text instead of footnotes.
So, I decided to test inline footnote functionality by generating a new xmin site and testing off of that. (I.e., all I did was make a new Rproj and then run blogdown::new_site(theme = "yihui/hugo-xmin")
). Inline footnotes do not work when testing. See below screencap.
However, regular footnotes do. See below screencap.
Is there a way to get inline footnotes working again with xmin? Thanks for your help!
I'm trying to open a bilingual blog recently. And please forgive my stupid request if you think it's against the minimal idea of this theme.
I found the script "build.R" will always create a README.md
at the parent directory of my blog site project. I think it is because of the destination directory is used as ../README.md
, and in many conditions the working directory is the project root directory. So that command will then creat a README.md
file at the parent directory of the project root directory, which is not intended.
file.copy('content/_index.markdown', '../README.md', overwrite = TRUE)
if (Sys.which('sed') != '') system("sed -i '' -e '1,6d' -e '34,38d' ../README.md")
cat(
'[![Screenshot](https://github.com/yihui/hugo-xmin/raw/master/images/screenshot.png)](https://xmin.yihui.name)\n',
file = '../README.md', append = TRUE
)
Hugo 0.55 deprecates preserveTaxonomyNames . How can I update the theme to make it compatible to this new version?
I've tried putting a favicon in:
The favicon doesn't display in any of these cases.
The 2 links on:
https://xmin.yihui.org/note/2017/06/14/another-note/
I would be interested to see the tutorial. ;)
Thanks
Keren
Seemingly this theme does not support Windows OS?
The following is the error information:
Rendering content/_index.Rmarkdown
running: bash -c "cd ../..;
find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l"
Quitting from lines 14-16 (_index.Rmarkdown)
Error in engine(options) : 14 ./bookdown-demo/style.css
127 ./bookdown-demo/toc.css
224 ./bookdown-demo/_book/applications.html
218 ./bookdown-demo/_book/final-words.html
227 ./bookdown-demo/_book/index.html
396 ./bookdown-demo/_book/intro.html
99 ./bookdown-demo/_book/libs/gitbook-2.6.7/css/plugin-bookdown.css
291 ./bookdown-demo/_book/libs/gitbook-2.6.7/css/plugin-fontsettings.css
426 ./bookdown-demo/_book/libs/gitbook-2.6.7/css/plugin-highlight.css
28 ./bookdown-demo/_book/libs/gitbook-2.6.7/css/plugin-search.css
10 ./bookdown-demo/_book/libs/gitbook-2.6.7/css/style.css
218 ./bookdown-demo/_book/literature.html
218 ./bookdown-demo/_book/methods.html
0 ./bookdown-demo/_book/placeholder.html
225 ./bookdown-demo/_book/references.html
14 ./bookdown-demo/_book/style.css
42 ./brain_network_viz/docs/config.html
49 ./brain_network_viz/docs/edge.html
58 ./brain_network_viz/docs/edge_renderer.html
51 ./
Calls: local ... process_group.block -> call_block -> block_exec -> in_dir -> engine
此外: Warning message:
运行命令'"bash" -c "cd ../..;
find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l"'的状态是123
停止执行
Error in render_page(f) : Failed to render 'content/_index.Rmarkdown'
In addition: Warning message:
running command '"C:/PROGRA~1/MICROS~1/ROPEN~1/R-3.4.3/bin/x64/Rscript" "C:/Users/zlgsa/Documents/R/win-library/3.4/blogdown/scripts/render_page.R" "content/_index.Rmarkdown" "E:/git/test"' had status 1
[1] TRUE
SessionInfo:
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RevoUtils_10.0.7 RevoUtilsMath_10.0.1
loaded via a namespace (and not attached):
[1] bookdown_0.6 Rcpp_0.12.15 later_0.6 digest_0.6.14 rprojroot_1.3-2 backports_1.1.2
[7] magrittr_1.5 evaluate_0.10.1 blogdown_0.5 stringi_1.1.6 rmarkdown_1.8.5 tools_3.4.3
[13] stringr_1.2.0 xfun_0.1 yaml_2.1.16 compiler_3.4.3 htmltools_0.3.6 knitr_1.18
Is it possible to display tags assigned to the post when we read the post, with minimal code writing?
Thanks!
Is it possible to change all instances of categories to topics?
Thanks,
Adam
Dear Xie
I read the blogdown book I read the recent updates on https://www.r-bloggers.com/2021/01/announcing-blogdown-v1-0/ and congratulations and thank you!
I was going to try out your theme Xmin (latest version), but I cannot find the config.toml file, not even in the ExampleSite directory. I thought you recommended using the config.toml instead of config.yaml, is that recommendation not applicable anymore?
Sorry if this is a silly question. Thank you so much for your receptivity and your excellent work.
EDIT: Ok converted the YAML file into TOML using this site https://www.convertsimple.com/convert-yaml-to-toml/ and carefully reading. Thank you silly problem is solved.
Hey, I was wondering if there was a way to suppress drafts from being visible under sections.
My homepage shows no posts because all of them are drafts, yet, if you go under sections, the posts appear.
Is there anything I can edit in the partials or is this a behavior that can't be changed (in which case I'll have to plan my workflow around it)?
Here's my source code
Thank you!
Hello.
By default hugo convert double quotes from "
to “
. On html code (&ldquo
&rdquo
).
How can I use default double and single quotes without converting?
The homepage of an xmin Hugo site contains a list of all posts under all pages. I have some old posts that I don't want to display on the homepage, I was wondering if it was possible to...
I would want this to only affect the homepage's list and not to touch the pages own lists.
Thanks! :)
Hi all,
Not sure if anyone else has experienced this, but the standard Github logo of the original site build no longer seems to render. Yet it still renders on the xmin example site. I have not made any changes to the content
folder. Not the end of the world, but couldn't figure it out after poking around for a bit - any suggestions?
I like your hugo-xmin theme very much . I have many categories and some subcategories, how to add subcategories ?
I covert wordpress xml to md file with your tools "oldblog_xml", then I use blogdown to format html files, but can't format html files.
author: sam
comments: true
date: 2015-04-29 15:56:59+00:00
layout: post
link: http://hugo.qinqianshan.com/wordpress-display-page-plugins-pagenavi/
slug: wordpress-display-page-plugins-pagenavi
title: Wordpress显示分页--插件Pagenavi
wordpress_id: 14
categories:
If I remove " layout" and "slug" ,it will format html files. Because I have 400 md files, if I remove "layout" and "slug" one by one ,it will take long time . Do you have any suggestions to solve this ?
Here's what Google Search Console says:
This is not a valid URL. Please correct it and resubmit.
Examples
URL:
/tags/checkwriter/
Line 5
Parent tag:
url
Tag:
loc
URL:
/post/2023/07/21/online-check-writing/
Line 8
Parent tag:
url
Tag:
loc
URL:
/
Line 11
Parent tag:
url
Tag:
loc
I would like to just have a traditional title with no box encapsulating it.
Which changes will I have to make? #
I did some research on Taxonomy Template of hugo, and tried to add a new variable, taxonomies
, in config.toml
. But seemingly newly added taxonomies do not appear in the New Post
addin panel. Will new taxonomies work anyway?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.