简体   繁体   English

发布图片的脚本

[英]Script that post image

I'm making a project, it's a website that list some events, here its preview: 我正在制作一个项目,它是一个列出一些事件的网站,以下是其预览:

https://i.imgur.com/yo20mTo.jpg https://i.imgur.com/yo20mTo.jpg

I can modify the html and css and post more events like the image above, but it's not practical if I have to alter the html every single time I want to post an event or update it. 我可以修改html和css并发布更多事件,如上图所示,但是如果我每次要发布事件或更新事件都必须更改html,这是不切实际的。

Is there any way to make a script to do it? 有什么办法可以制作脚本吗? Like a page where I just put things like event name, date, a image and stuff, and it generate an event like in the image above? 就像一个页面,我只在其中放置事件名称,日期,图像和东西之类的东西,它会像上面的图像那样生成事件?

To be more specific, an script that makes this just by typing the information I want: 更具体地说,一个脚本只需输入我想要的信息即可实现:

    <div class="item active">
      <img class="img-responsive" src="imagens/aero.jpg" alt="Image">
      <div class="carousel-caption">
        <h3>Aerosmith em São Paulo</h3>
        <p>Mais informações</p>



      </div>      
    </div>

Like a form that it automatcly creates it: 就像它会自动创建它的形式一样:

<div class="item active">

      </div>      
    </div>

Then i put an image: 然后我放一张图片:

   <div class="item active">
 <div class="item active">
   <img class="img-responsive" src="imagens/aero.jpg" alt="Image">
   <div class="carousel-caption">
          </div>      
        </div>

and then some info about it: 然后有关它的一些信息:

  <div class="item active">
      <img class="img-responsive" src="imagens/aero.jpg" alt="Image">
      <div class="carousel-caption">
        <h3>Aerosmith em São Paulo</h3>
        <p>Mais informações</p>
      </div>      
    </div>

and finally i post it and it gets like the image above. 最后我发布它,它变得像上面的图片。

You are talking about building a CMS. 您正在谈论构建CMS。 You may want to build your own, which can be fun, but likely you will want to use something that already exists and is easy to host. 您可能想要构建自己的游戏,这可能很有趣,但是可能您会想使用已经存在并且易于托管的东西。 One easy to use example would be Wordpress. 一个易于使用的示例是Wordpress。

Alternatively you could look at a static site generator (such as hugo ), which will generate html pages for you on your computer, which you can then upload to your hosting provider. 另外,您可以查看静态站点生成器(例如hugo ),它将在您的计算机上为您生成html页面,然后可以将其上传到托管服务提供商。

If you go the Hugo route, you will have to create a page template for each event, and then make a data file (it can use several formats like json or yml ) which contains the data for every event. 如果走Hugo路线,则必须为每个事件创建一个页面模板,然后制作一个数据文件(它可以使用jsonyml等多种格式),其中包含每个事件的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM