有没有办法在没有index.html的情况下生成hugo文件?

问题描述

我在hugo中有我的静态网站,这是文件夹结构:

Hugo static site init structure

我不为什么,当我执行 hugo -D 来构建hugo时,它会生成以下支架:

Scaffolding Image generated by Hugo

在构建hugo之后,我只想要定价,条款和隐私页面在根文件夹中,并带有各自的名称,而不是具有该名称且位于index.html文件中的文件夹。

注意:定价,条款和隐私页面使用的是#include <stdio.h> void resistor (void); float calc_freq(float ra,float rb,float c) // function to calculate Frequency { return 1.44/((ra+(2*rb))*c); } float calc_duty_cycle(float ra,float c) // function to calculate duty cycle { return (rb)/(ra+(2*ra)); } int main (void) { int choice; // choice to run program from start menu or quit while (1) { // Menu for entering resistor and capacitor values printf("Welcome to the 555 Timer Frequency and Duty Cycle Calculator\n"); printf("Please enter two resistor values in between "); printf("1 kOhms and 100 kOhms and a capacitor value\n\n"); printf("Menu\n\n"); printf("1. Continue\n"); printf("2. Exit\n"); scanf("%d",choice); switch (choice) { case 1: resistor(); break; case 2 : printf("Goodbye."); break; default: printf("Sorry I do not understand\n\n"); main(); } break; } return 0; } void resistor (void) { float ra,rb,c; // Float variables for two resistor values and capacitor while(1) // While loop to gather resistor A value { printf("Enter a value for Resistor Ra (kOhms): "); // First Resistor Value scanf("%f",&ra); if(ra < 1 || ra > 100) // Will repeat loop until value between 1 and 100 is entered printf("Invalid selection,choose again.\n"); else break; // breaks loop when valid data is entered } while(1) { printf("Enter a value for Resistor Rb (kOhms): "); // Second Resistor Value scanf("%f",&rb); if(rb < 1 || rb > 100) // Will repeat loop until value between 1 and 100 is entered printf("Invalid selection,choose again.\n"); else break; // breaks loop when valid data is entered } while(1) { printf("\nCapacitor (uF) : "); // Capacitor Value scanf("%f",&c); if(c <= 0) printf("Invalid selection,choose again.\n"); else { float freq = calc_freq(ra,c); // call function to calculate frequency float duty_cycle = calc_duty_cycle(ra,c); // cal function to calculate duty cycle printf("\nFrequency is: %.2f kHz\n",freq); // print frequency printf("Duty cycle is: %.2f percent\n",duty_cycle*100); // print duty cycle break; // break while loop } } }

解决方法

Hugo默认使用漂亮的链接,即以斜杠结尾且不扩展。那就是您所看到的输出,hugo在其自己的目录中创建一个索引文件。

这意味着您不会获得诸如example.com/pricing.html之类的URL,这通常是人们喜欢的。

如果您希望使用更扁平的结构,并且不介意显示.html扩展名的页面,则应启用uglyUrls。

URL management documentation for Hugo详细介绍了这两个选项。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...