Total Pageviews

Friday, 27 November 2026

让instinct帮我搭建基于vuejs+github issues的静态博客程序bib

 







 
我得到的博客地址:
brightmann.github.io/bib ,
 bib-d5l.pages.dev
 
项目地址:
 https://github.com/bingoogolapple/bga_issue_blog
 https://github.com/brightmann/bib/
 
创建源帖的方法:登录我的github a/c brightmann@gmail.com后,访问 https://github.com/brightmann/bib/settings,勾选issues.然后访问https://github.com/brightmann/bib/issues,在此创建new issue. 创建new issue就是在创建源帖。
 
    我曾经提交过问题: https://github.com/bingoogolapple/bga_issue_blog/issues/51,当时没解决。拖了2年后,instinct帮我解决了。
 

北征 杜甫

 

《北征》是唐代大诗人杜甫于唐肃宗至德二载(757年)闰八月创作的一首五言古诗,共一百四十句(七百字)。这首诗是杜甫离开凤翔行在、徒步回鄜州羌村探亲途中的纪行之作,也是中国文学史上现实主义长篇叙事诗的巅峰代表作之一。

全诗原文

皇帝二载秋,闰八月初吉。 

杜子将北征,苍茫问家室。 

维时遭艰虞,朝野少暇日。 

顾惭恩私被,诏许归蓬荜。 

拜辞诣阙下,怵惕久未出。 

虽乏谏诤姿,恐君有遗失。 

君诚中兴主,经纬固密勿。 

东胡反未已,臣甫愤所切。 

挥涕恋行在,道途犹恍惚。 

乾坤含疮痍,忧虞何时毕?

靡靡逾阡陌,人烟眇萧瑟。 

所遇多被伤,呻吟更流血。 

回首凤翔县,旌旗晚明灭。 

前登寒山重,屡得饮马窟。 

邠郊入地底,泾水中荡潏。
猛虎立我前,苍崖吼时裂。
菊垂今秋花,石戴古车辙。
青云动高兴,幽事亦可悦。
山果多琐细,罗生杂橡栗。
或红如丹砂,或黑如点漆。
雨露之所濡,甘苦齐结实。
缅思桃源内,益叹身世拙。
坡陀望鄜畤,岩谷互出没。
我行已水滨,我仆犹木末。
鸱枭鸣黄桑,野鼠拱乱穴。
夜深经战场,寒月照白骨。
潼关百万师,往者散何卒!
遂令半秦民,残害为异物。

况我堕胡尘,及归尽华发。
经年至茅屋,妻子衣百结。
恸哭松声回,悲泉共幽咽。
平生所娇儿,颜色白胜雪。
见耶背面啼,垢腻脚不袜。
床前两小女,补绽才过膝。
海图拆波涛,旧绣移曲折。
天吴及紫凤,颠倒在裋褐。
老夫情怀恶,呕泄卧数日。
那无囊中帛,救汝寒凛栗。
粉黛亦解包,衾裯稍罗列。
瘦妻面复光,痴女头自栉。
学母无不为,晓妆随手抹。
移时施朱铅,狼藉画眉阔。
生还对童稚,似欲忘饥渴。
问事竞挽须,谁能即嗔喝?
翻思在贼愁,甘受杂乱聒。
新归且慰意,生理焉得说!

至尊尚蒙尘,几日休练卒?
仰观天色改,坐觉妖氛豁。
阴风西北来,惨淡随回纥。
其王愿助顺,其俗善驰突。
送兵五千人,驱马一万匹。
此辈少为贵,四方服勇决。
所用皆鹰腾,破敌过箭疾。
圣心颇虚佇,时议气欲夺。
伊洛指掌收,西京不足拔。
官军请深入,蓄锐可俱发。
此举开青徐,旋瞻略恒碣。
昊天积霜露,正气有肃杀。
祸转亡胡岁,势成擒胡月。
胡命其能久,皇纲未宜绝。

忆昨狼狈初,事与古先别。
奸臣竟菹醢,同恶随荡析。
不闻夏殷衰,中自诛褒妲。
周汉获再兴,宣光果明哲。
桓桓陈将军,仗钺奋忠烈。
微尔人尽非,于今国犹活。
凄凉大同殿,寂寞白兽闼。
都人望翠华,佳气向金阙。
园陵固有神,扫洒数不缺。
煌煌太宗业,树立甚宏达。

 

核心脉络与分段解析

《北征》采用“自京赴奉先县咏怀五百字”类似的抒情与叙事交织结构,全诗按时间与空间推移,可分为五个紧密相连的层次:

  1. 辞朝启程与家国之忧(开头至“忧虞何时毕”): 杜甫因疏救房琯触怒肃宗,获准回乡探亲。临行前他仍忧心国事,感念“乾坤含疮痍”,定下了全诗沉郁顿挫的爱国基调。

  2. 北行途中的见闻与感怀(“靡靡逾阡陌”至“残害为异物”): 沿途所见尽是战乱后的荒凉与白骨,穿插着山野秋景(“菊垂今秋花,石戴古车辙”)的短暂慰藉,最后追思潼关溃败的惨痛历史教训。

  3. 抵家后的悲喜交集(“况我堕胡尘”至“生理焉得说”): 全诗最富生活气息和艺术感染力的段落。妻子“衣百结”、幼子“垢腻脚不袜”、小女补丁衣上“天吴及紫凤,颠倒在裋褐”,随后写小女儿学母亲涂脂抹粉、“狼藉画眉阔”的天真情态。以极细微的家庭日常反衬时代大悲剧,哀而不伤,暖意融融。

  4. 对借兵回纥与平叛局势的深谋(“至尊尚蒙尘”至“皇纲未宜绝”): 杜甫刚获家庭温情便转入政治思考,既肯定唐军蓄锐反攻的有利时机,又委婉提醒朝廷对借兵回纥需保持警惕(“此辈少为贵”),体现了政治家的远见。

  5. 回顾马嵬事变与中兴期望(“忆昨狼狈初”至结尾): 总结安史之乱爆发的教训(诛杀杨国忠、赐死杨贵妃),赞扬陈玄礼等忠烈将士,最终归结到对“煌煌太宗业”必将中兴的坚定信念。

艺术特色与历史地位

  • “诗史”的典范:全诗如同一部微缩的安史之乱编年史,从朝堂政治、军事得失、外交隐忧到百姓流离、家庭困顿,无一不真切入画。

  • 白描细节传神:不避俗事、不讳琐细,将补丁衣服上的刺绣图案、小女孩画歪的眉毛写得活灵活现,开宋诗以文为诗、质朴写实风气之先。

  • 格局宏大,转折自然:从个人私情自然过渡到军国大计,感情大开大合,既具《离骚》般的忠爱忧愤,又有史传文学的严谨脉络.

秦妇吟

 1.《秦婦吟》

作者:韋莊(唐代)

中和癸卯春三月,洛陽城外花如雪。
東西南北路人絕,綠楊悄悄香塵滅。
路旁忽見如花人,獨向綠楊陰下歇。
鳳側鸞欹鬢腳斜,紅攢黛斂眉心折。
借問女郎何處來?含顰欲語聲先咽。
回頭斂袂謝行人:喪亂漂淪何堪說!
三年陷賊留秦地,依稀記得秦中事。
君能為妾解征鞍,妾亦與君停玉趾。

前年庚子臘月五,正閉金籠教鸚鵡。
斜開鸞鏡懶梳頭,閒憑雕欄慵不語。
忽看門外起紅塵,已見街中擂金鼓。
居人走出半倉惶,朝士歸來尚疑誤。
是時四面官軍入,擬向潼關為警急。
皆言博野自相持,盡道賊軍來未及。
須臾主父乘奔至,下馬入門癡似醉。
適逢紫蓋去蒙塵,已見白旗來匝地。

扶羸攜幼競相呼,上屋緣牆不知次。
南鄰走入北鄰藏,東鄰走向西鄰避。
北鄰諸婦咸相湊,戶外崩騰如走獸。
轟轟崐崐乾坤動,萬馬雷聲從地湧。
火迸金星上九天,十二官街煙烘烔。
日輪西下寒光白,上帝無言空脈脈。
陰雲暈氣若重圍,宦者流星如血色。
紫氣漸隨帝座移,妖光暗射台星拆。
家家流血如泉湧,處處冤聲聲動地。
舞伎歌姬盡暗捐,嬰兒稚女皆生棄。

東鄰有女眉新畫,傾國傾城不知價。
長戈擁得上戎車,回首香閨淚盈把。
旋抽金線學縫旗,才上雕鞍教走馬。
有時馬上見良人,不敢回眸空淚下。

西鄰有女真仙子,一寸橫波剪秋水。
妝成只對鏡中春,年幼不知門外事。
一夫跳躍上金階,斜袒半肩欲相恥。
牽衣不肯出朱門,紅粉香脂刀下死。

南鄰有女不記姓,昨日良媒納新聘。
玻璃階上不聞聲,翡翠簾前空見影。
忽看庭際刀刃鳴,身首支離在俄頃。
仰天掩面哭一聲,女弟女兄同入井。

北鄰少婦行相促,旋折雲鬟拭眉綠。
已聞擊托壞高門,不覺攀援上重屋。
須臾四面火光來,欲下迴梯梯又摧。
煙中大叫猶求救,樑上懸屍已作灰。

妾身倖得全刀鋸,不敢踟躕久回顧。
旋梳蟬鬢逐軍行,強展娥眉出門去。
舊里從茲不得歸,六親自此無尋處。
一從陷賊經三載,終日驚憂心膽碎。
夜臥千重劍戟圍,朝餐一味人肝膾。
鴛幃縱入豈成歡,寶貨雖多非所愛。
蓬頭面垢狵眉赤,幾轉橫波看不得。
衣裳顛倒言語異,面上誇功雕作字。
柏臺多士盡狐精,蘭省諸郎皆鼠魅。
還將短髮戴華簪,不脫朝衣纏繡被。
翻持象笏作三公,倒佩金魚為兩史。
朝聞奏對入朝堂,暮見喧呼來酒市。

一朝五鼓人驚起,叫嘯喧爭如竊議。
夜來探馬入皇城,昨日官軍收赤水。
赤水去城一百里,朝若來兮暮應至。
兇徒馬上暗吞聲,女伴閨中潛色喜。
皆言「冤憤此時銷」,必謂「妖徒今日死」。
逡巡走馬傳聲急,又道軍前全陣入。
大彭小彭相顧憂,二郎四郎抱鞍泣。
沉沉數日無消息,必謂軍前已銜璧。
簸旗掉劍卻來歸,又道官軍悉敗績。
四面從茲多厄束,一斗黃金一升粟。
尚讓廚中食木皮,黃巢機上刲人肉。
東南斷絕無糧道,溝壑漸平人漸少。
六軍門外倚殭屍,七架營中填餓殍。
長安寂寂今何有,廢市荒街麥苗秀。
採樵斫盡杏園花,修寨誅殘御溝柳。
華軒繡轂皆銷散,甲第朱門無一半。
含元殿上狐兔行,花萼樓前荊棘滿。
昔時繁盛皆埋沒,舉目淒涼無故物。
內庫燒為錦繡灰,天街踏盡公卿骨。

來時曉出城東陌,城外風煙如塞色。
路傍時見游奕軍,坡下寂無迎送客。
霸陵東望人煙絕,樹鎖驪山金翠滅。
大道俱成棘子林,行人夜宿牆匡月。
明朝曉至三峰路,百萬人家無一戶。
破落田園但有蒿,摧殘竹樹皆無主。

路旁試問金天神,金天無語愁於人。
廟前古柏有殘枿,殿上金爐生暗塵。

「一從狂寇陷中國,天地晦明風雨黑。
案前神水呪不成,壁上陰兵驅不得。
閒日徒歆奠饗恩,危時不助神通力。」

「我今愧恧拙為神,且向山中深避匿。
寰中簫管不曾聞,筵上犧牲無處覓。
旋教厭鬼傍鄉村,誅剝生靈過朝夕。」

妾聞此語愁更愁,天遣時災非自由。
神在山中猶避難,何須責望東諸侯。
前年又出楊震關,舉頭雲際見荊山。
如從地府到人間,頓覺時清天地閒。
陝州主帥忠且貞,不動干戈唯守城。
蒲津主帥能戢兵,千里晏然無戈聲。
朝攜寶貨無人問,暮插金釵唯獨行。

明朝又過新安東,路上乞漿逢一翁。
蒼蒼面帶苔蘚色,隱隱身藏蓬荻中。

問翁:「本是何鄉曲?底事寒天霜露宿?」
老翁暫起欲陳詞,卻坐支頤仰天哭:

「鄉園本貫東畿縣,歲歲耕桑臨近甸。
歲種良田二百廛,年輸戶稅三千萬。
小姑慣織褐絁袍,中婦能炊紅黍飯。
千間倉兮萬斯箱,黃巢過後猶殘半。
自從洛下屯師旅,日夜巡兵入村塢。
匣中秋水拔青蛇,旗上高風吹白虎。
入門下馬若旋風,罄室傾囊如捲土。
家財既盡骨肉離,今日殘年一身苦。
一身苦兮何足嗟,山中更有千萬家。
朝饑山上尋蓬子,夜宿霜中臥荻花。」

妾聞此老傷心語,竟日闌干淚如雨。
出門唯見亂梟鳴,更欲東奔何處所?
仍聞汴路舟車絕,又道彭門自相殺。
野色徒銷戰士魂,河津半是冤人血。

適聞有客金陵至,見說「江南風景異。
自從大寇犯中原,戎馬不曾生四鄙。
誅鋤寇盜若神功,惠愛生靈如赤子。
城壕固護教金湯,賦稅如雲送軍壘。」

奈何四海盡滔滔,湛然一境平如坻。
避難枉為闕下人,懷安卻羨江南鬼。

願君舉棹東復東,詠此長歌獻相公。

校勘提醒:不同敦煌寫本與整理本有異文,以上以維基文庫所載通行文本為底本整理。原文中有「一作」異文的字句,這裡採用其中一種讀法。

创作背景:
唐僖宗广明元年(880)黄巢起义军进驻长安,战事残酷,百姓蒙受深重苦难;韦庄当时因应举滞留长安,亲历家人生离、困居卧病的动荡,是这场社会巨变的目击者,离开长安后经一年酝酿完成诗作。
内容简介:全诗以逃难秦妇的视角叙事,记述义军攻入长安后的战乱惨状

(使我想起白居易的‘长恨歌’)

2. 韋莊《菩薩蠻·人人盡說江南好》
人人盡說江南好,
遊人只合江南老。
春水碧於天,
畫船聽雨眠。

壚邊人似月,
皓腕凝霜雪。
未老莫還鄉,
還鄉須斷腸。

3. 韋莊《菩薩蠻·洛陽城裡春光好》
洛陽城裡春光好,
洛陽才子他鄉老
。
柳暗魏王堤,
此時心轉迷。

桃花春水綠,
水上鴛鴦浴。
凝恨對殘暉,
憶君君不知
。

4. 韋莊《台城》
江雨霏霏江草齊,
六朝如夢鳥空啼。
無情最是台城柳,
依舊煙籠十里堤。

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

相关帖子:

韦庄:秦妇吟

Thursday, 26 November 2026

让muse帮我在cloudflare.com平台搭建基于nodejs+d1数据库+r2存储空间的博客程序microfeed

 me: can u build https://github.com/brightmann/mf?


Yes, I can — but first, a quick heads-up on what this one is.

mf is a fork of microfeed — a lightweight CMS that runs on Cloudflare Pages + D1 database + R2 storage, with an admin dashboard (login via Cloudflare Zero Trust). It's not a static blog like the others, so it needs real setup:

  • a D1 database (FEED_DB) and an R2 bucket for media
  • a GitHub Actions deploy with repo secrets: CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN (Pages + D1 edit), and R2 API keys
  • a PAT from you for the push, like the other builds

One more thing: when I pulled the repo, it flagged an execution-risk check — installing and building its code can run scripts from the repo. Same situation as nbtn before, where you said yes and we went ahead.

Want me to go ahead and build it?

me: yes. what risks do the repo have?

 

Checked the code and the repo state. Here's what I found — worst first:

1. The admin dashboard has no login in the code at all.
functions/admin/_middleware.js just loads data and lets everything through. The only thing standing between the internet and /admin is a Cloudflare Zero Trust (Access) policy you set up on the dashboard. If that step is skipped or misconfigured, anyone can open the admin, publish/delete posts, upload files to R2, and change settings. The public API (/api) is different — it does check an API key.

2. Your fork is 308 commits behind upstream, with zero of your own commits on top.
It's a plain snapshot of microfeed from Feb 2026. Whatever fixes upstream shipped since — including security fixes — you don't have. Upstream is a small alpha project, so the gap matters more than it would for a big framework.

3. Old dependencies.
axios 1.2.1 (Dec 2022), @swc/core 1.3.8, eslint 8 (end-of-life), React 18.2. I haven't run an audit yet — that's install-time. One смягчение: axios here only runs in the browser admin UI posting to your own site, not server-side, so the worst axios CVEs don't directly apply.

4. Secrets handling during deploy.
The deploy flow keeps the Cloudflare API token and R2 keys in a plaintext .vars.toml on disk, and sync_project_config.js also copies the Cloudflare API token itself into the Pages project's environment variables — where the running code doesn't even use it. Good news: nothing secret is committed in the repo right now, and .gitignore covers .vars.toml / .env.

5. By design, but worth knowing: uploaded media goes to a public R2 bucket — anything uploaded is world-readable. And the repo is public, so a single mistaken commit of .vars.toml would expose the keys.

None of these are blockers if the Zero Trust login is set up properly — that's the one that actually decides whether the site is safe to run. Want me to continue with the build, and set up the Zero Trust login as part of it?

Quick status: the local build passes — webpack compiles clean (only size warnings on the big admin bundles) and all 7 jest tests pass.

I'm now creating the Cloudflare tokens in the dashboard (one API token for Pages + D1, one R2 key for media storage) so I can set up the D1 database, R2 bucket, and Pages project. I'll keep going once those come back.

 Create the token yourself (like you did for snnb): a cloudflare API token named mf-deploy with Pages Edit + D1 Edit + User Details Read on the Luckypoem account. the build itself is already verified and waiting.

 me: my cloudflare api token's value here...

Good progress while waiting on the R2 keys — done with your API token:

  • D1 database mf_feed_db_production created, tables (channels/items/settings) in place
  • R2 bucket mf-media created with the upload CORS rules (mf itself is too short — bucket names need at least 3 characters)
  • Pages project mf created (mf-1s7.pages.dev)

Still just need the R2 Access Key ID + Secret from the dashboard, then I can deploy.

me:  now i updated the api token, u try again。

(我所选择的 api token的权限:

}
 
 
me: the api token is ok?

Yes, the token is OK — and it did the whole job. After your update, the R2 credentials derived from that token work too (Access Key ID = the token's ID, Secret = a hash of its value), so I didn't need a separate R2 token after all.

It's live: https://mf-1s7.pages.dev

The homepage redirects to /admin for setup since the feed is empty — that's expected on a fresh install. D1 db, R2 bucket, and the Pages project are all in place.

Two things to flag:

  1. Don't revoke this token. The site's R2 upload keys are derived from it, so revoking it would break media uploads.
  2. Still to do: enable public access on the R2 bucket (r2.dev) and set up the Zero Trust login for /admin, which you approved. Both need the dashboard — my browser still can't get past its verification check, so those are on your side.

they're two different jobs, and both are needed:

  1. Public access on the R2 bucket — this is about readers seeing your images. Uploaded media lives in the bucket; without a public URL, images in posts won't load for anyone. I just enabled it via the API, so the bucket now has a public address: https://pub-57709f541d2d4bb1bcb383af1a723d0b.r2.dev. One last step on your side: paste that URL into the admin's public bucket URL field (Admin home → Setup Checklist, or Settings → web).

  2. Zero Trust login for /admin — this is about security. The app has no login of its own, so right now anyone can open /admin and publish or delete posts. The Zero Trust policy puts a login gate in front of it, so only you get in.

So the order I'd do them: Zero Trust first, since /admin is wide open at the moment — that one needs the Cloudflare dashboard (Zero Trust → Access → add an application for mf-1s7.pages.dev/admin/* with your email allowed). The bucket part is already done.

me: i visited https://dash.cloudflare.com/one/access/onboarding ,it shows 'We could not find that page. The page you are looking for has moved or no longer exists".

me:  it's a headache.

Yeah, it is — Cloudflare moved the pages around and the setup link just bounces to a dead page. The site itself is fine and live, so this can wait. The admin is open for now, but there's nothing in it yet, so no real risk today.

If you want, I can skip Cloudflare's dashboard entirely and build a simple password lock into /admin instead. 

me:  Add a password lock to /admin instead.U set the password as complex as u can.

Done — /admin now asks for a password. I verified it live: no password gives a 401, wrong password gives a 401, and the right one loads the admin. The public site still works fine, and the admin's save/publish endpoints are locked too.

Your login:

  • Username: admin
  • Password: muse给我设置的密码

Your browser will pop up a login box when you open https://mf-1s7.pages.dev/admin 。 just paste those in. Save it somewhere safe; if you ever want it changed, tell me and I'll rotate it.

One note: this lock lives in the code, which I deployed but haven't pushed to GitHub yet (that needs a repo token from you whenever you want it).

me:  if u push the code changes to my repo, the code changes doesn't include the pw's value?

Correct — the password value is nowhere in the code. I checked the actual diff: the only change is functions/admin/_middleware.js, and all it says is "read the password from the environment variable ADMIN_PASSWORD". The value itself lives in two places, neither of which gets pushed:

  • The Pages secret on the Cloudflare dashboard
  • The local .vars.toml file, which is gitignored

So pushing is safe. The only other local changes are the pnpm scaffolding files, which I'd leave out (and the package.json edit I'd revert first, like I noted before).

me:  my github repo token here...

Pushed — commit a12a215 on main, just the one file (functions/admin/_middleware.js). I reverted the local-only package.json edit and set the pnpm files aside first, so nothing extra went in. And as confirmed before, the password value isn't in the push — the code only reads it from the environment.

The push didn't trigger a deploy (the repo's deploy workflow is manual-only), but the live site already has the lock from the direct deploy earlier. You can revoke that token now.

 

me:  about the blog https://mf-1s7.pages.dev/ ,can u implement adding slug?

Done — slugs are live on the blog, and pushed to your repo (commit eae31b7).

What changed: there's now a Slug field in the post editor, right under the title. Set it to something like fh and the post URL becomes /i/fh-<id>/ instead of the title-derived one. If you leave it empty, nothing changes — it falls back to the title like before. Old id-only URLs still work too.

One thing worth knowing: your Chinese-titled posts currently get raw Chinese in their URLs (e.g. /i/中华民族是一个优秀民族吗-<id>/), since the old code derived the slug from the title. Setting a slug on those posts in the editor will clean that up.

me:  as in a post https://mf-1s7.pages.dev/i/%E4%BB%80%E4%B9%88%E6%A0%B7%E7%9A%84%E4%BA%BA%E6%89%8D%E6%98%AF%E4%BD%A0%E7%9A%84%E7%90%86%E6%83%B3%E5%AF%B9%E8%B1%A1-RmSrvADu20Z/ , there is chinese characters, i don't like this kind of url.

 

Fixed — that post now lives at

I set its slug to ideal-partner. The homepage, the feed, and the post's own canonical link all point to the new clean URL now, and the old Chinese URL still works, so nothing breaks. If you'd rather have a different slug, just change it in the post editor — the Slug field is right under the title.

Your other 4 posts still have Chinese characters in their URLs. Want me to give them slugs too, or would you rather set them yourself in the editor?

me:  ok,give them english slugs too.

 

All done — every post now has a clean English URL, using the same short slugs you use on your other blogs:

  • 战马 → /i/fh-…/
  • 稀奇古怪的中国经济 → /i/ce-…/
  • 人生忠告 → /i/life-advice-…/
  • 歌声 → /i/song-sound-…/
  • 中华民族是一个优秀民族吗 → /i/chinese-people-…/
  • 父亲的滋补经 → /i/nutrition-…/

Plus the two already set: 理想对象 → ideal-partner, and the one you set yourself, correct-character. All verified live, and the old Chinese URLs still work if anything linked to them.

 

得到的博客地址: https://mf-1s7.pages.dev

登录地址: https://mf-1s7.pages.dev/admin/

  • Username: admin
  • Password: muse给我设置的密码  
  •  项目地址:

     https://github.com/microfeed/microfeed

     https://github.com/brightmann/mf

     

     


     

    从0开始配置Cloudflare Zero Trust:永久免费高速VPN注册全攻略

     

    清朝历代皇帝

     

    清朝(1616年建国,1636年改国号为清,1644年入关)共历十二位皇帝。若从努尔哈赤建立“后金”算起共十二帝,若从皇太极改国号为“大清”算起共十一帝,若从顺治帝入关算起共十帝。

    以下为清朝历代皇帝的完整列表(按继位顺序排列):

    顺序庙号谥号(简称)姓名年号在位时间备注
    1太祖高皇帝爱新觉罗·努尔哈赤天命1616年—1626年建国号“金”(史称后金),创立八旗制度
    2太宗文皇帝爱新觉罗·皇太极天聪、崇德1626年—1643年1636年改族名为满洲,改国号为“大清”
    3世祖章皇帝爱新觉罗·福临顺治1643年—1661年1644年清军入关,迁都北京,成为入关后首位皇帝
    4圣祖仁皇帝爱新觉罗·玄烨康熙1661年—1722年在位61年,中国历史上在位时间最长的皇帝
    5世宗宪皇帝爱新觉罗·胤禛雍正1722年—1735年设立军机处,推行摊丁入亩、改土归流等改革
    6高宗纯皇帝爱新觉罗·弘历乾隆1735年—1796年实际掌权64年(含3年太上皇),“康乾盛世”顶峰
    7仁宗睿皇帝爱新觉罗·颙琰嘉庆1796年—1820年诛杀和珅,清朝由盛转衰的转折期
    8宣宗成皇帝爱新觉罗·旻宁道光1820年—1850年爆发第一次鸦片战争,签订《南京条约》
    9文宗显皇帝爱新觉罗·奕詝咸丰1850年—1861年太平天国运动与第二次鸦片战争爆发,病逝于承德
    10穆宗毅皇帝爱新觉罗·载淳同治1861年—1875年慈禧太后垂帘听政,“同治中兴”与洋务运动兴起
    11德宗景皇帝爱新觉罗·载湉光绪1875年—1908年推行戊戌变法失败,经历甲午战争与八国联军侵华
    12无无(或称逊帝)爱新觉罗·溥仪宣统1908年—1912年1912年2月12日颁布退位诏书,清朝灭亡

    历史分期与冷知识

    • “一帝一年号”的惯例: 从顺治帝开始,清朝严格执行“一世一元”制,即一位皇帝在位期间只使用一个年号,因此后世习惯直接用年号指代皇帝(如“康熙帝”、“乾隆帝”)。唯有皇太极先后使用过“天聪”(后金时期)和“崇德”(大清时期)两个年号。

    • 同治、光绪、宣统三朝的特殊性: 这三位皇帝均无亲生子嗣,且在位期间军政大权长期由慈禧太后(或摄政王载沣)掌控。溥仪退位后,北洋政府曾给予其《清室优待条件》,直至1924年冯玉祥发动北京政变将其逐出紫禁城。

    唐朝历代皇帝

     

    唐朝(618年—907年)共历21位皇帝(含武则天建立武周时期),国祚289年。以下是唐朝历代皇帝的完整世系与在位情况:

    顺序庙号谥号姓名在位时间年号备注
    1高祖神尧大圣大光孝皇帝李渊618年—626年武德开国皇帝,玄武门之变后退位为太上皇
    2太宗文武大圣大广孝皇帝李世民626年—649年贞观开创“贞观之治”,被尊为“天可汗”
    3高宗天皇大圣大弘孝皇帝李治649年—683年永徽、显庆、龙朔等在位期间唐朝版图达到最大,后期由武后参政
    4中宗大和大圣大昭孝皇帝李显

    684年


    705年—710年

    嗣圣


    神龙、景龙

    两次即位,第一次在位仅55天即被废
    5睿宗玄真大圣大兴孝皇帝李旦

    684年—690年


    710年—712年

    文明、光宅、垂拱等


    景云、太极、延和

    两次即位,前后均受制于武则天或太平公主
    ——则天顺圣皇后武曌(武则天)690年—705年天授、长寿、神功等改国号为“周”,中国历史上唯一正统女皇帝
    ——殇皇帝李重茂710年唐隆韦后所立傀儡皇帝,在位仅17天(史称唐少帝)
    6玄宗至道大圣大明孝皇帝李隆基712年—756年先天、开元、天宝前期开创“开元盛世”,后期爆发“安史之乱”
    7肃宗文明武德大圣大宣孝皇帝李亨756年—762年至德、乾元、上元平定安史之乱,后期宦官专权渐起
    8代宗睿文孝武皇帝李豫762年—779年宝应、广德、永泰、大历彻底平定安史之乱,但藩镇割据局面正式形成
    9德宗神武孝文皇帝李适779年—805年建中、兴元、贞元推行“两税法”,后期姑息藩镇、任用宦官
    10顺宗至德弘道大圣大安孝皇帝李诵805年永贞病重失音,推行“永贞革新”,在位仅8个月退位
    11宪宗昭文章武大圣至神孝皇帝李纯805年—820年元和削平藩镇,开创“元和中兴”,后为宦官所弑
    12穆宗睿圣文惠孝皇帝李恒820年—824年长庆朝政渐废,牛李党争日益剧烈
    13敬宗睿武昭愍孝皇帝李湛824年—827年宝历沉迷游乐,年仅18岁被宦官杀害
    14文宗元圣昭献孝皇帝李昂827年—840年大和、开成发动“甘露之变”除宦官失败,遭软禁郁郁而终
    15武宗至道昭肃孝皇帝李炎840年—846年会昌任用李德裕,史称“会昌中兴”,推行会昌灭佛
    16宣宗元圣至明成武献文睿智章仁神聪懿道大孝皇帝李忱846年—859年大中勤于政事,史称“大中之治”,被称为“小太宗”
    17懿宗昭圣恭惠孝皇帝李漼859年—873年咸通骄奢淫逸,民变四起,唐朝国势急转直下
    18僖宗惠圣恭定孝皇帝李儇873年—888年乾符、广明、中和等在位期间爆发黄巢起义,两度逃离长安
    19昭宗圣穆景文孝皇帝李晔888年—904年龙纪、大顺、景福等试图复兴皇权但受制于军阀,终被朱温所杀
    20哀帝哀皇帝(后唐谥昭宣光烈孝皇帝)李柷904年—907年天祐朱温傀儡,907年禅位于朱温,唐朝灭亡

    补充说明

    • 人数统计差异:传统史学通常称唐朝有“二十帝”或“二十一帝”,差异主要在于是否计入武则天(建国号为周,自立一朝)以及在位仅十余天的唐殇帝李重茂。若将两者均计入,则共21位君主(23次登基)。

    • 历史阶段划分:

      • 初唐(618年—712年):高祖至睿宗(含武周),政权建立、贞观之治与武周革唐。

      • 盛唐(712年—755年):玄宗开元至天宝前期,国力达于极盛。

      • 中唐(755年—820年):安史之乱爆发至宪宗元和中兴,由盛转衰、藩镇割据。

      • 晚唐(820年—907年):穆宗至哀帝,宦官专权、牛李党争、农民起义直至灭亡。