标签: static-html

在另一个苗条文件中包含一个苗条文件

我正在开发一个静态网站(所以没有真正的服务器支持),我想在另一个网站中包含一个小的细长片段,可能会将变量传递给它.

这可能吗?在rails中很容易,虽然render方法,但我不知道如何在苗条上做(显然load方法不适用于苗条).

ruby static-html slim-lang

5
推荐指数
2
解决办法
6373
查看次数

Netlify上的分支特定环境变量

我们正在为所有推送的git分支使用Netlify的自动部署.

我们希望仅将分析脚本(等)包含在主分支中,即我们的用户正在访问的网站版本.

可以在Netlify上构建环境变量,但如果可以区分某些分支的变量,我不会得到它们吗?

git deployment environment-variables static-html netlify

5
推荐指数
1
解决办法
1151
查看次数

使用hamlet呈现静态HTML

如何使用hamlet框架从Haskell内部生成静态HTML页面?

注意:这个问题故意不表示研究工作.对于我的研究工作,请参阅下面的问答式答案.

haskell static-html hamlet

4
推荐指数
1
解决办法
703
查看次数

EnableWebMvc抛出ServletException:无法解析具有名称的视图

使用静态HTML页面玩Spring Boot + MVC,同时注意到这件事:

首先,我有:

指数控制器:

@Controller
public class IndexController {

    @RequestMapping("/")
    public String index() {
        return "index.html";
    }

    @RequestMapping("/{path:[^\\.]+}/**")
    public String forward() {
        return "forward:/";
    }
}
Run Code Online (Sandbox Code Playgroud)

Html文件是:...\src\main\resources\static\index.html

所以当我的主应用程序类是:

@SpringBootApplication
public class MyApplication extends WebMvcConfigurerAdapter {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

一切运作良好,默认路径:localhost:8080\我得到index.html页面内容

但是,如果我使用注释Application类 @EnableWebMvc

@SpringBootApplication
@EnableWebMvc
public class MyApplication extends WebMvcConfigurerAdapter {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

我得到例外:javax.servlet.ServletException: Could not resolve view with …

java spring-mvc static-html spring-boot

3
推荐指数
1
解决办法
2万
查看次数

保护承载静态公共网站的EC2实例

我正在尝试在Amazon EC2 小型Linux实例上托管公共网站.我的网站很简单,因为它没有数据库和任何花哨的服务器组件.它只是在Apache网络服务器上托管的一堆普通旧html.

我需要采取哪些安全措施(防火墙配置?,ddos预防?)以防止我的网站被污损或被拒绝访问?我的linux知识有限,所以我很感激这里的任何建议/帮助.

linux security amazon-ec2 static-html amazon-web-services

2
推荐指数
1
解决办法
101
查看次数

Spring启动映射静态html

我想创建spring boot web应用程序.

我有两个静态html文件:one.html,two.html.

我想将它们映射如下

localhost:8080/one
localhost:8080/two
Run Code Online (Sandbox Code Playgroud)

不使用模板引擎(Thymeleaf).

怎么做?我已经尝试了很多方法来做到这一点,但我有404错误或500错误(圆形视图路径[one.html]:将调度回当前处理程序URL).

OneController.java是:

@Controller
public class OneController {
    @RequestMapping("/one")
    public String one() {
        return "static/one.html";
    }
}
Run Code Online (Sandbox Code Playgroud)

项目结构是

在此输入图像描述

spring-mvc static-html spring-boot

2
推荐指数
1
解决办法
7743
查看次数

所见即所得html DIV之外抛出的WordPress简码

我正在尝试通过Wordpress页面所见即所得(WYSIWYG)编辑器在特定<div>元素中在页面中放入一个简码。短代码确实会出现并起作用。但是<div>,当页面呈现时,它不会停留在my内,而不会呈现在<div>页面的顶部附近,而是引导页面内容。

关于如何防止这种情况有什么想法?

我不想将其放在页面模板内。我试图将其放置在Pages WYSIWYG编辑器内布置的简单自定义html中。

例如,我在页面中放置简码,如下所示:

<div class="row">
<p>some custom page html content</p>
<div>
<div class="row">
[some_shortcode]
</div>
<div class="row">
<p>some custom page html content</p>
<div>
<div class="row">
<p>some custom page html content</p>
<div>
Run Code Online (Sandbox Code Playgroud)

而是这样渲染:

<!-- THE SHORTCODES HTML APPEARS HERE and Works but not where I wanted it. -->
<!-- then the rest of the pages html content -->
<div class="row">
<p>some custom page html content</p>
<div>
<div class="row"><!-- no more shortcode-->
</div>
<div …
Run Code Online (Sandbox Code Playgroud)

html wordpress static-html shortcode

0
推荐指数
1
解决办法
718
查看次数

如何在Nuxt中加载静态HTML页面(避免Nuxt请求)

我有一个 nuxt 网站,其中有一个unsupported page. 我注意到当我只想显示一个没有外部请求的静态页面时,Nuxt 正在加载它的文件,因为它是一个简单的页面,没有理由加载所有那一堆文件。

\n\n

所以问题是:当访问 Nuxt 特定路由时,如何提供静态 HTML 文件,例如:/unsupported.

\n\n

现在我正在使用空布局提供页面:

\n\n
<template>\n  <div class="unsupported">\n    <div class="container">\n      <i class="unsupported-icon fa fa-frown-o" />\n\n      <h1>Seu navegador n\xc3\xa3o \xc3\xa9 suportado</h1>\n      <h2>Para usar o Cinemax, n\xc3\xb3s recomendamos que use a vers\xc3\xa3o mais recente do <a href="#">Firefox</a>, <a href="#">Chrome</a> ou <a href="#">Safari</a></h2>\n    </div>\n  </div>\n</template>\n\n<script>\nexport default {\n  layout: \'empty\'\n}\n</script>\n\n<style lang="scss">\n.unsupported {\n  display        : flex;\n  flex-direction : column;\n  justify-content: center;\n  align-items    : center;\n\n  &-icon {\n    font-size: 4rem;\n  }\n}\n</style>\n
Run Code Online (Sandbox Code Playgroud)\n\n

但我需要它只是一个普通的 …

static-html nuxt.js

0
推荐指数
1
解决办法
4287
查看次数