Total Pageviews

Monday, 14 October 2024

静态网站空间neocities.org

 注册并登录后,在此:

https://neocities.org/site_files/text_editor?filename=index.html 编辑index.html 文件,然后按save按钮,即可保存修改。

在编辑index.html时,当我们写标题时,可以这样写,比如:

<h2 id="快乐的节日"></h2>
<h2><a href="#快乐的节日">快乐的节日</a></h2> 

这样,即可把标题‘快乐的节日’做成超链。

 又比如:

<h2 id="被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一"></h2>
<h2><a href="#被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一">被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一</a></h2> 

把标题做成超链后,方便你把该文的超链地址发给别人,别人访问该超链地址,即可访问相应的文章。

如果把index.html放在网站的根目录下,无法把全部网站的标题做成列表,于是可以在后台新建blog目录(访问https://neocities.org/dashboard),然后把网站的根目录下的index.html文件移动到子目录blog目录里。然后在网站的根目录下,建立一个新的index.html文件,内容如下:

<meta charset="UTF-8">

<p><h2><a href=https://luckypoem.neocities.org/blog/about.html>about me</a></h2>

<ul>

<li><h2 id="美丽的草原,我的家(马头琴)"></h2>

<h2><a href="blog/#美丽的草原,我的家(马头琴)">美丽的草原,我的家(马头琴)</a></h2>

<li><h2 id="快乐的节日"></h2>

<h2><a href="blog/#快乐的节日">快乐的节日</a></h2>

<li><h2 id="被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一"></h2>

<h2><a href="blog/#被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一">被评为世界No.1,中国最安逸的城市,它排第二,没谁敢称第一</a></h2>

<li><h2 id="稀奇古怪的中国经济"></h2>

   <h2><a href="blog/#稀奇古怪的中国经济">稀奇古怪的中国经济</a></h2>

   </ul>

我的示例网站:https://luckypoem.neocities.org/

参考:https://www.htmldog.com/guides/html/beginner/links/

---------------------------------------------------------------------------------------------------

         Neocities.org - the web site. Yep, the backend is open source!

neocities.org

The web site for Neocities! It's open source. Want a feature on the site? Send a pull request!

Getting Started

Neocities can be quickly launched in development mode with Vagrant. Vagrant builds a virtual machine that automatically installs everything you need to run Neocities as a developer. Install Vagrant, then from the command line:

vagrant up --provision

Vagrant takes a while, make a pizza while waiting

Make a copy of config.yml.template in the root directory, and rename it to config.yml. Then:

vagrant ssh
bundle exec rackup -o 0.0.0.0

Now you can access the running site from your browser: http://127.0.0.1:9292

from https://github.com/neocities/neocities

-------------------------------------------------------------

The Neocities CLI

Manage your site using a shell terminal

Neocities has a CLI for power users that want to upload sites using a command line.

Features

  • Push support - uploads an entire directory. Great for static site generators.
  • HTTP persistence - the CLI reuses a single HTTP connection, improving performance.
  • Check before upload - checks if the file data matches before uploading.
  • Gitignore parsing - automatically skips files in root gitignore file for git repositories.

Install Instructions

If you're using a newer version of OSX or already have Ruby installed, just run this command to install:

gem install neocities

If you get a permission error, you may need to run the command as superuser:

sudo gem install neocities

After installation, just run the command to get started:

$ neocities

|\---/|
| o_o |   Neocities
 \_-_/

Subcommands:
  push        Recursively upload a local directory to your site
  upload      Upload individual files to your Neocities site
  delete      Delete files from your Neocities site
  list        List files from your Neocities site
  info        Information and stats for your site
  logout      Remove the site api key from the config

Windows

If you're using Windows, you can install ruby with something like the Ruby Installer, and then run the above command.

Linux / BSD

Most Linux / BSD distributions come with Ruby packages. For example, with Ubuntu:

sudo apt-get install ruby-full A full list of available install options for ruby is here.

Git Hooks

If you want to create a git hook to automatically upload your site to Neocities when you run "git push", you can run this command in the root directory of your git repo:

printf '#!/bin/sh\nneocities push .' >.git/hooks/pre-push && \
chmod u+x .git/hooks/pre-push

If the files you're pushing are in a subdirectory of the root git repo, replace the "." with the subdirectory. For example, with Jekyll (which typically uses _site):

printf '#!/bin/sh\nneocities push _site' >.git/hooks/pre-push && \
chmod u+x .git/hooks/pre-push

Note: You will need to be logged in for the git hook to work, so run "neocities push" on the directory you want to upload before installing this hook. This will be fixed in a later version of the CLI.

from https://neocities.org/cli

 

No comments:

Post a Comment