Comments (5)
It's a very interesting issue. In fact, if you don't mind, you can leave a comment under my post, and when I see it I will reply to you as soon as possible. (But you can't receive a email notification, which I'll fix later.)
OK, let's back to our topic. There are many ways to do this.
- The best way I think you can intergrate markdown content and raw HTML code is to enable the unsafe feature of markup renderer.
You can add this to your site'sconfig.toml
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
hardWraps = false
unsafe = true
xHTML = true
Due to safety concerns, renderer disabled this feature by default (keeping away any possible XSS attacks).
2. There are also a way to implement the insertion of raw HTML:
You can directly rename the post from .md
to .html
Hugo can compile HTML files with frontmatter.
But while using HTML, only HTML code is allowed, no markdown code will be compiled.
from hugo-theme-diary.
And another thing I should remind is, this theme is under MIT license.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Under MIT license, users have freedom to do many things, but they should reserve the copyright declaration of this theme. :)
from hugo-theme-diary.
It's a very interesting issue. In fact, if you don't mind, you can leave a comment under my post, and when I see it I will reply to you as soon as possible. (But you can't receive a email notification, which I'll fix later.)
OK, let's back to our topic. There are many ways to do this.
- The best way I think you can intergrate markdown content and raw HTML code is to enable the unsafe feature of markup renderer.
You can add this to your site'sconfig.toml
[markup] [markup.goldmark] [markup.goldmark.renderer] hardWraps = false unsafe = true xHTML = true
Due to safety concerns, renderer disabled this feature by default (keeping away any possible XSS attacks).
2. There are also a way to implement the insertion of raw HTML:
You can directly rename the post from.md
to.html
Hugo can compile HTML files with frontmatter.
But while using HTML, only HTML code is allowed, no markdown code will be compiled.
Thanks for your help, I was thinking of a Tag Plugins solution like Hexo.
One more thing is the favicon params can be mentioned in wiki, for head.html
{{ if .Site.Params.favicon }}
<link rel="icon" href="{{ .Site.Params.favicon }}">
<!-- favicon -->
As for the pages should be distinguished from posts, in my humble opinion, pages won't be shown in homepage, I took a simple way to practise this function by adding a param named hide :
{{range .Paginator.Pages}}
{{$hidePage := .Params.hide}}
{{if $hidePage}}
{{else}}
{{if and (.IsPage) (.Params.date)}}
Of course, there is another way to practise better, like using something like {{ range }}
that I am not familiar with.
I suppose it would be cool that the theme will add the searching function like using ajax live search, maybe in the feature?
from hugo-theme-diary.
And another thing I should remind is, this theme is under MIT license.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Under MIT license, users have freedom to do many things, but they should reserve the copyright declaration of this theme. :)
In fact, I do keep the copyright declaration of this theme, but not as a substantial portions way.
For the developing convenience, I tested my features by commenting out all the original parts of the footer. I'd like to add the copyright declaration in the near future.
from hugo-theme-diary.
Thanks for your support.
from hugo-theme-diary.
Related Issues (20)
- Question about adding an author for posts HOT 4
- 是否可以考虑使用此字体 HOT 1
- 夜间模式下看不见表格内容 HOT 2
- images not displaying HOT 2
- Dark mode refactor HOT 4
- Single quote is replaced with ’ HOT 6
- How to add RSS feed? I don't understand where to add rss link. HOT 3
- Google Analytics 4 will be replaced by Universal Analytics HOT 3
- Way to remove the darkmode toggle? HOT 1
- The About page appears on the homepage article list HOT 2
- <br> new line is not supported in this theme? HOT 1
- Summary feature required
- Can you add Artalk comment function?
- Language meta label and <h1> needed for better SEO HOT 2
- Drawers are not hidden when clicking ToC items on mobile view. HOT 1
- Fix highlighting
- 作者能麻烦您考虑一下加上视频播放功能吗 HOT 1
- URL for Tags does not seem to use baseURL
- error calling Paginator: pagination not supported for this page HOT 5
- iOS safari scrolls pages upwards / incorrect css syntax when headlines are used? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-theme-diary.