除了在每个页面上复制和粘贴它之外,是否可以创建一个网站? [英] Is it possible to create a web site aside copying and pasting it on every page?

查看:120
本文介绍了除了在每个页面上复制和粘贴它之外,是否可以创建一个网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立我自己的博客,我会有很多文章,因此,每次复制和粘贴头部,或者一边说,博客的页脚或一些重复部分都是愚蠢的。

I'm building my own blog and I would have lots of articles, so, copying and pasting the head every time, or an aside, the footer or some repeated parts of the blog would be stupid.

所以,我正在寻找一种简单方法。我听说过模板(但不知道它是什么)并找到了答案:是否有可能创建一个网站标题而无需在每个页面上复制和粘贴它?但似乎这不是我的意思我正在寻找。

So, I'm looking a way to do it in an easy way. I heared about templating (but don't know what it is) and found this answer: Is it possible to create a web site header without copying and pasting it on every page? but it seems that is not what I'm looking for.

我听说过HAML和Markdown(HTML预处理器)并且不知道他们是否习惯于做我需要的事情。

I heared about HAML and Markdown (HTML Preprocessors) and don't know if they are used to do what I need.

我想要找到的解决方案类似于Sass中的 @import

The solution I want to find is something like @import in Sass.

我有一个 @importhead.scss; 并且在编译后的文件中我没有重复manualy(在这种情况下是导入模块head.scss)

I have an @import "head.scss"; and in the compiled file I hadn't repeated manualy the (in this case an "imported module" head.scss)

我可能会说我正在学习用Jekyll开发我的静态博客,因为我想学习使用这个技术,第二我知道如何使用WordPress,Joomla和学习一个新的东西对我来说会很有趣,但我不想学习PHP所以我认为这个项目的模板语言会更容易

I might say I'm learning to develop my static blog with Jekyll, just because I want to learn to use this technology, and second I know how to use WordPress, Joomla and learning a new thing would be interesting for me but I don't want to learn PHP so I think a templating language will be easier for this project

推荐答案

如果你想使用Jekyll ,您可以使用 包含 来避免重复代码。

If you want to use Jekyll, you can use includes to avoid repeating code.

这篇关于除了在每个页面上复制和粘贴它之外,是否可以创建一个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆