npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

blogsystem

v0.6.3-maintain3

Published

博客系统,可自定义整个网站

Downloads

41

Readme

说明

默认主题比较简陋欢迎有识之士来写主题 已支持全局安装,全局安装后,执行 blog -h,初始化目录使用blog init 文件夹名称,进入文件夹,执行blog sync 启动监视,自带about.md测试文章 由于全局安装未经足够测试,可能存在bug,如存在bug请等待后续版本修复 博客系统,用于解决现有静态博客系统的弊端比如自定义网站和使用动态网站困难生成麻烦等 状态:目前基本可用 现状说明:当前已经支持独立程序和创建独立blog目录,自动生成blog模板,blog程序已经可以打包但二进制文件只在release中发布,独立bin程序没有外部依赖直接放入PATH中即可使用 当前,直接global安装,已实现全平台支持,执行blog -h查看选项 目前使用的commander比较简陋,其中一切是或否的选项都用y和n表示

使用说明(clone仓库法)

前提:

  • 本地安装有 nodejs>=12.14.0
  • 全局安装 npm yarn 使用步骤:
  1. 克隆此仓库到本地目录,并在仓库目录执行yarn安装全部依赖
  2. 在sites目录里放置自己的主题(例 default)
  3. 在config文件夹里放置自己的配置文件(可省略这一步)
  4. 使用yarn blog -h 查看说明并使用 开发服务器使用说明:
  • 开发服务器启动为 yarn blog sync
  • 开发服务器默认使用default.json配置
  • 开发服务器启动会使用指定配置文件重新生成所有内容
  • 如果提交到github且网站的地址中带有path,请将path加入base_url中,github.json 配置文件有此示例

使用说明(独立程序)

  1. 单文件版:下载release下对应系统版本的程序文件(单文件)放到一个目录,把这个目录加入PATH环境变量中,运行blog -h
  2. 绿色安装版:下载安装包并解压压缩包到一个目录,执行install脚本执行安装,执行uninstall脚本卸载
  3. 安装版:下载安装包,双击启动安装程序,按提示安装

设计理念

  • 网站优先原则,不使用模板+内容生成静态页面,而是调用网站的hook脚本让网站自己决定如何整合内容,并可提供包括动态更新主页推荐等伪动态功能
  • 提供者原则,在整合内容方面,提供EJS等模板引擎,允许网站自己选择使用这些模板引擎来合成静态页面,系统只提供可选的设施实现
  • 插件原则,尽量把功能用可装卸的插件实现,如transtormer可用于将各种格式的文章转换为内容页
  • 多格式原则,将多种格式转化为中间格式,允许同一方式使用(目前支持3种格式,未来将格式作为插件提供,从外部加载)
  • 自描述原则,配置文件和各种可能与人直接接触的文件采用自描述概念,即文件本身包含对自己各部分数据的描述和修改它的程序,如在txt前面附上记事本的程序,或在json中带有说明和类型校验信息,并通过统一的json编辑器编辑

Blog目录说明

  1. sites:保存所有可用主题(site),文件夹名即主题名
  2. nowSite:生成时会把当前主题复制到这个目录,当前主题在config中配置,此目录中的内容不可手动修改
  3. articles:内容文章目录,内容生成到content目录中,允许网站自己加载调用
  4. content:保存生成的文章,文章被转换为中间格式,目前中间格式的实现为一个可嵌入的HTML页面,当嵌入此页面时,会显示文章内容,未来可能需要在隔离性上做文章
  5. plugins: 插件目录,其中可能存在transformers 等目录,提供各种功能插件

开发说明

开发说明为有意为此项目做贡献的人准备 开发目前主要通过dev程序进行,dev程序可启动tsc监视app app/Helper 目录的代码文件改动并实时编译
同时启动sync程序,启动服务器和内容生成程序,开发者可实时在浏览器实时查看文章内容更改
对同样配置文件中配置的site进行监视,自动编译ts文件并监控其改动,实时同步到nowSite目录,这样开发者可在浏览器中实时看到对主题(site)的修改,方便测试开发
使用流程:

  • clone仓库
  • 启动 yarn blog dev (使用default配置文件,可查看帮助-h 以自定义配置文件)
  • 修改程序代码或其他文件
  • 在浏览器中或shell中查看或使用

如何打包

执行yarn pkg打包为独立可执行文件,默认配置为只生成windows版本的exe,可在package.json中配置

Site(主题)说明

  1. 统一网站入口,index.html
  2. 服务端事件钩子在本地切换网站时,生成内容时,调用对应的钩子脚本
  3. hook.js导出一个钩子对象,将在合适时机调用,用于生成静态页面或实现伪动态更新

计划

  • [ ] 考虑整合EJS并兼容HEXO模板